Acrobat Xi Pro: Checking Status Of A Checkbox To Affect Calculation
I'm trying to add calculations to a form someone else created, and I'm a little stuck on the JS. One set of fields has two possible calculations depending on whether the associated
Solution 1:
It might be useful to have a closer look at the Acrobat Javascript documentation, which is part of the Acrobat SDK, downloadable from the Adobe website.
A checkbox has a return value; that is the field value when it is checked. When it is not checked, its value is always "Off".
The simplest way to test for a (single) checkbox would look like this:
if (this.getField("myCheckBox").value != "Off") {
// the box is checked // do what should be done when the box is checked
} else {
// the box is not checked // do what should be done when the box is not checked
}
In many cases, a smart choice of the return value of the check box can simplify calculations.
Post a Comment for "Acrobat Xi Pro: Checking Status Of A Checkbox To Affect Calculation"