Skip to main content
Participating Frequently
March 10, 2017
Question

Need help with a calculation field on a PDF form.

  • March 10, 2017
  • 1 reply
  • 638 views

I'm trying to do a calculation in a field in my form where the value is the product of one field (which I select) X 670.  I think I need some sort of java script to make this happen.  Is this something where I could get the basic script and fill in my data??

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 10, 2017

The script is very simple:

event.value = Number(this.getField("Enter field name here").value) * 670;

Participating Frequently
March 10, 2017

thank you for your reply.

Understand that I don't know java script at all so I'm just guessing -  this is what I put in there and it did not work:

event.value = Number(this.getFieldQuantity.value) * 670;

The name of my field is "Quantity"

So when someone puts a number in that field (i.e. 2) , when they tab to the next field (the one with the code) it should automatically multiple by 670 and put the value in that field.  Am I understanding this correctly?

Here is a screen shot of my form.  You can see the fields under "INITIAL LCE ORDER"

Any help with this would be appreciated!

try67
Community Expert
Community Expert
March 10, 2017

All you had to change in the code is to replace "Enter field name here" with the actual field name... Nothing else.

Use this code:

event.value = Number(this.getField("Quantity").value) * 670;