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

If else syntax javascript for LiveCycle

moto05
Registered: Jul 20 2011
Posts: 1

Hi Forum Users,

I need your help for these conditional field in LiveCycle (I'm a new user of this application).
 
I have 3 fields: d1 (dropdown list), t1 (text field), c1 (checkbox).
I want this behaviour:
- - -
if d1 = "a"
 
if c1 = on
t1 = "aon"
 
if c1 = off
t1 = "aoff"
 
- - -
if d1 = "b"
 
if c1 = on
t1 = "bon"
 
if c1 = off
t1 = "boff"
- - -
if d1 = "c"
 
if c1 = on
t1 = "con"
 
if c1 = off
t1 = "coff"
- - -
if d1 = "d"
 
if c1 = on
t1 = "don"
 
if c1 = off
t1 = "doff"
- - -
else
 
if c1 = on
t1 = "xxxon"
 
if c1 = off
t1 = "xxxoff"
 
Thank you,
Alex

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
When you test the value of a check box or radio button it must be its off or unselected value. The value for Acrobat Acrobat created forms is the string "Off" and this behavior is not user settable. For LiveCycle Designer the default value is "0" or what ever value the form designer assigns to the unselected or off status.

You also need to learn the syntax of the 'if' statement and the comparative operators. "=" is the set operator, "==" or "eq" is the equal comparative operator.

For a complex decision like this I would look at using the 'switch' statement as one can write quite a complex 'case' statement for the selection of a block of action.

George Kaiser