Skip to main content
designm19985728
Participating Frequently
March 5, 2018
Answered

Calculations on form

  • March 5, 2018
  • 1 reply
  • 1179 views

I need several calculation done on a pdf form, can someone tell me how to do this?

Currently looks like this:

Total No.  [TOTAL]  @ £250 each =  [TOTAL 1]

[CHECK BOX 1]   plus 10% =   [TOTAL 2]

[CHECK BOX 2]   plus 20% =   [TOTAL 3]

so i need [TOTAL 1] to multiply [TOTAL] by 250

then when a check box is selected a final sum is made from [TOTAL 1]

This is the first time i have made a form, and now i need to try and figure all this out, any help welcome.

This topic has been closed for replies.
Correct answer try67

when i try and do this it says:

SyntaxError: unterminated string literal

and it won't allow me to ok it


Sorry, my mistake. Use this:

if (this.getField("CHECK BOX 1").valueAsString=="Off") event.value = "";

else event.value = Number(this.getField("TOTAL 1").valueAsString) * 1.1;

1 reply

try67
Community Expert
Community Expert
March 5, 2018

Under the Simple Field Notation option of the Calculate tab of TOTAL 1 enter this:

250 * TOTAL

Under TOTAL 2 enter this:

1.1 * TOTAL\ 1

Under TOTAL 3 enter this:

1.2 * TOTAL\ 1

designm19985728
Participating Frequently
March 5, 2018

got the first one to work (x250), but not the other two.

Does it need a rule on the CHECK BOX, to tell it to put a number into TOTAL 2 ?

try67
Community Expert
Community Expert
March 5, 2018

If you only want the value to show when the check-box is ticked then use this code (as the custom calculation script):

if (this.getField("CHECK BOX 1").valueAsString=="Off") event.value = "';

else event.value = Number(this.getField("TOTAL 1").valueAsString) * 1.1;