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

If Then calculation

cregier
Registered: Oct 25 2010
Posts: 5
Answered

I am trying to do a basic if-then calculation, but have not been able to find the right info in the formcalc manual or other forum posts so far.
 
I have a table with the first column being check boxes of various values, the second column is merely text. One set of calculations is based on the varying values of the check boxes, but I have created an invisible set of corresponding text fields that I need to simply have a value of "1" if the check box is "on"
 
My first row in the table is as follows:
cell1 is a check box named "TheoConstruct" (with a value of 2 for on and 0 for off), cell2 is a text box with text.
 
I have a text field separate from the table in which I would like to make the calculation. This text field is named "class1"
 
I'm new to formcalc, so I know this is probably fairly simple, but I don't know how to make it work.
 
What I need to know is how to write the following in proper formcalc.
 
If TheoConstruct = 2 then class1 = 1.
 
(TheoConstruct (Cell1 which I renamed) is Row1 of Table1)
Thank you for your help!

My Product Information:
LiveCycle Designer, Windows
cregier
Registered: Oct 25 2010
Posts: 5
This is as close as I've been able to get, but still getting error messages.

if (Table1.Row1.TheoConstruct==HasValue (2)) then (class1==HasValue(1)) endif

Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

If your table and text field are in the save level, then try the following by coding into "click" event for the TheoConstruct.

if ($.rawValue == 2) thenclass1.rawValue = 1elseclass1.rawValue = 0endif
cregier
Registered: Oct 25 2010
Posts: 5
Thank you so much, that works perfectly!