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

Need Formcalc "If function" help

jgiampietro
Registered: Oct 20 2009
Posts: 7

Hello!

To the point: I am trying to create a from wherein the user can make a selection form a drop box of various categories of cabins (I.e. "4B Inside"), and, depending on what the user selects, an output of a certain $ amount will be placed in another field. I have scripted, into the field where I would like the result, the following (no subforms are used, the language is formcalc, so everything should be on the same heriarchal level, language is formcalc):

If (DropDownList1==4) then (Cell2==459.00) elseif (DropDownList1==6) then (Cell2==659.00) endif

This string does not produce an error when tested in reader or within Livecycle, however, it ALWAYS returns the result "0" in Cell2, irrespective of which I choose (4 or 6).

Additionally, if I attempt to refer to DropDownList1 as "4B Inside" in the string, and name the choice in DropDownList1 thusly, I receive a script error where text, as opposed to numbers, begin. Is this function not possible in formcalc, or is it referenced as something other than "If"?

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

you should use "rawValue" to get the current value of dropdownList1.

 form1.#subform[0].Cell2::calculate - (FormCalc, client) if (DropDownList1.rawValue == 4) then$.rawValue = "459.00"elseif (DropDownList1.rawValue == 6) then$.rawValue = "659.00"else$.rawValue = "0.00"endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs