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

Display True or False

vpd85
Registered: Mar 19 2009
Posts: 39
Answered

Hy,
I need a script to display in the field True or False.

Example:

In a field i want to be displaied TRUE or FALSE, in function by another field.
TRUE when value is 100 and FALSE when value is different by 100.

Thanks!

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Maybe a JS in this way

if (Textfield1.rawValue = "100")
{
Textfield2.rawValue = "TRUE";
}
else
{
Textfield2.rawValue = "FALSE";
}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

vpd85
Registered: Mar 19 2009
Posts: 39
I try to put the script in the calculate event, but dont works :(, also, i try the others events, but still dont works.

Thanks!
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Remember, this is JavaScript not FormCalc.
Check the settings of the Script Editor.
And use a textfield for user input to display the result, not a static text.

I've tested it.
2 fields, one for input, one for the result.
This JS in the calculate event of the result field works as you expected.

if (NumField1.rawValue == "100")
{
this.rawValue = "TRUE";
}
else
{
this.rawValue = "FALSE";
}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

vpd85
Registered: Mar 19 2009
Posts: 39
Many many thanks! Works!