Skip to main content
Participating Frequently
September 23, 2025
Question

Help with a JavaScript for Addition and Subtraction

  • September 23, 2025
  • 2 replies
  • 219 views

I need help with a JavaScript to add 3 fields then subtract the 4th field to get a total in the 5th field.

If someone could please take a look at the script in the field GRANDTOTAL, I would be so appreciative. 

2 replies

Thom Parker
Community Expert
Community Expert
September 23, 2025

This has already been answered in another thread.

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Nesa Nurani
Community Expert
Community Expert
September 23, 2025

Your field names are wrong, JavaScript is case-sensitive, you also have issue with field calculation order.

Here is your file with script and calculation order fixed.