Trying to create a form with a Results box that has PASS, FAIL and VOID. When user chooses the Result I want the Comments Text field to display different verbiage if the result is a PASS, FAIL, OR VOID.
I have tried to do this but keep getting errors. I am new to FormCalc. I just want to do an If statement, I'm so confused! :)
Here is what I have: ----- form1.#subform[0].Table2.Row1.DropDownList4::click: - (FormCalc, client) ---------------------
if (DropDownList4 == PASS) then
Comments1.addItem = No leakage detected
Endif
First, fields in XFA all have a property called "rawValue" which lets you retrieve and/or set its value. In FormCalc, this is the default property at all times. This means that in order to set a field's value in FormCalc, you simply need to use the following syntax:
FieldName = Value
"FieldName", in your case, would be "Comments1".
Second is the fact that you're attempting to assign a string of characters to the Comments1 field however you haven't enclosed those characters in double quotes. Without the double quotes, the FormCalc scripting engine interprets each word as a statement and fails because it doesn't know what "no", "leakage" and "detected" mean. The same goes for the comparison of "PASS" to the DropDownList4 field's value. To fix this problem, simply enclose the string value in double quotes. If, however, you were assigning/comparing a numerical value to the field, then you wouldn't need the double quotes because the scripting engine would recognize the series of digits as a numerical value.
Your script should therefore look like this:
Stefan Cameron obtained his bachelor's degree with Honors in Computer Science at the University of Ottawa and is a Computer Scientist working on Adobe's LiveCycle server products, in particular on LiveCycle Designer ES for the past 5 years.