justinmind-logo
 
Upvote 2

Text box prompt

Answered Victor Conesa 8 years ago

Hello,


How do you insert a text box prompt in the actual text box.


For example if you are creating a sign in page how would you create a text box with the words username in the box, but as soon as you clicked into the box this would disappear for you to type in your actual username?


Hope I'm making sense

Replies (5)
photo
1

Hi Ryan,


First get an input text field widget and then write the desired text within the widget.


Then, create an 'on focus in' event with the condition that states when the text field = 'username'. Then have the outcome set the value of the text field to blank.


Let me know if you have any further questions or would like some clarification on this.


Best,


Danielle

photo
1

Sorry for the thread necromancy, but I'm trying to do the same thing as above, and I've been able to add a labelled "Name" text box where the text disappears upon clicking on it. However, I cant seem to work out how do I get the text to refill should the user not type anything.


i.e: if textvalue = 'blank' then replace with "Name"

photo
1

"On focus out" set value "Name" in input


So if the user click elsewere, your input would have the value "Name"

photo
1

The problem with that is, if the user filled in their name.. say "Pierre" it would overwrite it to "Name" from what i've tried. If i'm doing this wrong please let me know

photo
1

Hi Daniel,


Sorry, I forgot to consider the condition "should the user not type anything"


You need to add the condition


if Input = ''


to your interaction.


Attached image are the 2 interactions your input should have.


eedcd7ef263bea341cdef8fca6e79fed


Leave a Comment
 
Attach a file