Highlighted

default text replaced with user entered info.

_Mel_bush_

19-03-2009

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!

Replies

Highlighted

pguerett

19-03-2009

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?
Highlighted

tltagami

05-10-2009

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!

Highlighted

pguerett

05-10-2009

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