These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Like a Tool tip....

patra
Registered: Oct 19 2006
Posts: 270

How I can enter into a text field the text: (eg. Languages, Art skills, Music etc.)
for example, but when a user enters into the field the text disappears allow them to enter their data.

Something like a tool tip....

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You will need two scripts for each text field.

First one to check if the field has still your default text example like "Your text" when entering the field.

 Formular1.#subform[0].Textfield1::enter - (JavaScript, client)if (this.rawValue == "Your text"){this.rawValue = null;}

and the second to place your default text example into the field if the user lefts the field unfilled.

 Formular1.#subform[0].Textfield1::exit - (JavaScript, client)if (this.rawValue == null){this.rawValue = "Your text";}

Example file
https://share.acrobat.com/adc/document.do?docid=6932d05e-1ee8-4141-b0a4-87305ccca18a

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

patra
Registered: Oct 19 2006
Posts: 270
Thanks very much Radzmar for your help!

That all I need with one more addition.
Is it possible the default text "Your text" can be in gray font colour
but the entering text in black?
Is it possible?

Thanks radzmar
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Yes it is.

Change the script for the exit event in the following way:
if (this.rawValue == null){this.rawValue = "Your text";xfa.resolveNode("Formular1.#subform.Textfield1").font.fill.color.value = "192,192,192";}else{xfa.resolveNode("Formular1.#subform.Textfield1").font.fill.color.value = "0,0,0";}

Here an example
https://share.acrobat.com/adc/document.do?docid=1de73ab6-0267-4b89-b74c-3c9863606ff3

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Tech264
Registered: Apr 4 2008
Posts: 111
I just wanted to say that this is a really good tip. Thanks for sharing this information.
patra
Registered: Oct 19 2006
Posts: 270
Thanks Ranzmar
That was really a good one!!!!
patra
Registered: Oct 19 2006
Posts: 270
One more last touch for this one!
Is it posiible the default text(Your text) do not print if the user do not enter any data?

Thanks again
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
No, but you can set the font color to white ("255.255.255"), witch has the same effect, don't you think so?! ;-)

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

patra
Registered: Oct 19 2006
Posts: 270
I like to share with everyone there.
For TextField1 enter the scripts below:

On Preprint event
if (this.rawValue == "Your text")
{
xfa.resolveNode("form1.#subform[0].TextField1").font.fill.color.value = "255,255,255";
}
else
{
xfa.resolveNode("form1.#subform[0].TextField1").font.fill.color.value = "0,0,0";
}

On postprint event
if (this.rawValue == "Your text")
{
xfa.resolveNode("form1.#subform[0].TextField1").font.fill.color.value = "180,180,180";
}

Thanks