Skip to main content
Participant
April 17, 2024
Question

I need a script for Acrobat Form Field calculation

  • April 17, 2024
  • 1 reply
  • 198 views

I have a form with a Goup1 Radion Buttons, Wage and Classified. When Classified is selected I want a calculation in the Field "Semi Monthly" that takes Field "Salary" and divides by 24. 

This is what I started with:

var classified = this.getField("Field Classified").value;
var salary = this.getField("Field Salary").value;

if (classified === "Yes") {
    event.value = salary / 24;
} else {
    event.value = ""; // Blank if not classified
}
This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
April 17, 2024

Looks good. What is the issue?  

If the script is simply not doing anything, then the field names may be incorrect. Look in the Console window (ctrl-j) to see if any errors are reported.

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often