Expand my Community achievements bar.

default text replaced with user entered info.

Avatar

Former Community Member
I have searched all over to see how this is done. I found one other response to this question, but it was not complete.



Basically what I am wondering is, how do I set up my text field so that there is a default text to signify what the user should type into the box. When the user clicks the text field, this default is removed so they can begin typing.



Thank you!
5 Replies

Avatar

Former Community Member
You can enter your default text into the field by loading it in Designer, highlighting the field and entering the text you want into the Deafult area under the Object/Value palette. Now in the script editor under the Enter event you can add this javascript code:



this.rawValue = "";



Be aware that if the user goes back into that field at a later time then the value they previously entered will disappear as well.



A more better way woudl be to see if the field value was the same as the dafault and if it was then clear it. Assuming the default text was "Please enter data here!", you could write javacript code like something like this:



if (this.rawValue == "Please enter data here!"){

this.rawValue = "";

}



With this technique you will not overwrite anything they previously entered.



Make sense?

Avatar

Level 4

I'm a newbie at this and not very experienced with Javascript. I tried to add this code to the script editor for a field, but I am getting a script error. I made sure the default language was Java in Properties. Could you please expand this step by step with everything I need to put in the editor box?

Thanks!

Avatar

Former Community Member

It woudl be easier to see hwat you have done and suggest ways of correcting it.

Also coudl you expand on what you are trying to do?

Paul

Avatar

Level 4

Actually, just after I posted this, I figured it out. But thank you for the speedy reply!

Avatar

Former Community Member
Thank you so incredibly much! You really, really helped me!!!!!!!!!!!! It worked perfectly.