1

I am not a programmer to I need an example in (pref. Formcalc) or Javascript to enter in the script editor of Livecycle for an interactive order form I am creating.

I need "ItemTotal[31]" field to perform a calculation only when "Add-onCheckBox1" is clicked. Once Add-onCheckBox1 is clicked I want the ItemTotal[31] field to calculate the Quantity field multiplied by 300 and return the results this field. Below is what I tried but keep getting errors.

if (Add-onCheckBox1 == 1) then    
 ItemTotal[31] == Quantity *300 
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Appgal
  • 11
  • 1
  • 2

1 Answers1

0

in JavaScript it should be something like this:

if (Add-onCheckBox1.rawValue == 1){
    xfa.resolveNode("ItemTotal[31]").rawValue = xfa.resolveNode("Quantity").rawValue * 300;
}

You can put this script in the change event of the Add-onCheckBox1 field.

I haven't the opportunity to test your FormCalc script in Designer, but for sure there is an error in the assignment, it should be:

ItemTotal[31] = Quantity * 300;
AlessioG
  • 81
  • 2
  • First of all, THANK YOU. It is however, not working. I appears that the value of Add-OndCheckBox1 is not changing when it is clicked. What code do I need to enter (and where) to get the value to change? – Appgal May 13 '11 at 13:56
  • Appgal, the script works (I tested it right now) if you put the quote after the ItemTotal[31] part. – AlessioG May 19 '11 at 20:09