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

help me understand this "if"!!!

josegarcia_66
Registered: Aug 5 2009
Posts: 4

i have three elements:

a (drop down list) with three choices: one, two, three

a (text field) with this javascript code in the calculate event:

if(DropDownList1.rawValue == "one")
{
TextField1.rawValue = "ONE";

if(TextField1.rawValue == "ONE")

{
NumericField1.rawValue = 1;
}
}

and a (numeric field).....

my question is... when i make a choice from the drop down list and choose "one", this should change the text field value to "ONE" and the numeric field to "1".... but instead i get "1" on both the textField and the numericField... why?

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

I wasn't able to reproduce your problem, but I would use another script.
Put this one into the change:event of your dropdown box.

  1. if (xfa.event.newText == "One")
  2. {
  3. Textfield1.rawValue = xfa.event.newText;
  4. NumericField1.rawValue = 1;
  5. }

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs