Skip to main content
Participant
Apr 17, 2024 5:40 PM UTC
Question

I need a script for Acrobat Form Field calculation

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 is closed to new replies. Start a new post to keep the conversation going.

1 reply

Thom Parker
Community Expert
Community Expert
Apr 17, 2024 7:06 PM UTC

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.

 

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