Trying to reveal a text box

I’m trying to get a text box (or anything really) that when clicked reveals another text box which displays an email address (thinking it’s safer than having the email on display?). Unfortunately i havent a clue about coding but did manage to set up a working database with the help of YouTube but cant find any examples of what I want to do with this scenario.

I have selected the ‘onClick’ on the 1st text box and entered textBox2 next to it. Then I selected hidden on load for the 2nd box but I cannot make the 2nd box show itself when the 1st one is clicked. I am assuming I have to put some code in for an event but dont know what to put.

$w.onReady( function () {
//TODO: write your page related code here…
});
export function text19_click(event, $w) {
//Add your code for this event here:
}
export function text20(event, $w) {
//Add your code for this event here:
}
Any help would be gratefully received.
Thanks
Daisy

Hi Daisy,

Welcome to the Wix Code forums.

You should use the show() command of the text box. Something like this:
$w(“#text20”).show();

You will need to familiarize yourself with basic coding concepts to accomplish what you want. There are a wealth of Javascript coding sites which will help you learn Javascript from basic to advanced - Javascript.info is a good one. The Wix Code Resources page provides tutorials, examples, and articles on getting the most out of Wix Code. We are happy to get you pointed in the right direction, but you’ll need to take it from there. As questions or difficulties arise, we are here to help.

Good luck and have fun,

Yisrael

Thanks. Put me in right direction but took me ages to get it exactly right as i hadnt a clue what i was doing and the articles didnt help because i couldnt understand them. Turns out I was only missing a couple of words which i managed by trial, error and guessing.

:tada: