Fix an Acrobat Calculated Field That Does Not Display a JavaScript Result
Question details
The user needs an Acrobat calculated field to display a corrected value based on two other form fields.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A custom calculation reads MEASURE1 and TEMP1 and uses exponentiation to calculate an adjusted value.
- Observed behavior
- The calculated field does not display a result.
Open the PDF in Adobe Acrobat and use Prepare a Form to identify the destination field and confirm the exact names of the two source fields. Enter numeric test values in MEASURE1 and TEMP1.
Replace the exponentiation operator with Math.pow()
Use this calculation when the Acrobat JavaScript engine may not support the double-asterisk exponentiation operator.
In Acrobat, open Prepare a Form, right-click the destination field, and select Properties. On the Calculate tab, select Custom calculation script and click Edit.
Replace the calculation script with: var v1 = Number(this.getField("MEASURE1").value); var v2 = Number(this.getField("TEMP1").value); event.value = Math.round(v1 / Math.pow(2, (77 - v2) / 27));
Click OK to save the script, close field properties, and preview the form. Enter numeric values in MEASURE1 and TEMP1 and check the destination field.

Check Acrobat form calculation settings
Use these checks if the corrected script still does not update the destination field.
Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Office files. Its format compatibility helps you move existing documents into your workflow, although it does not fix Acrobat JavaScript calculations.

Frequently Asked Questions
Why should I use Math.pow() instead of ** in Acrobat?
Some Acrobat JavaScript engines may not support the ** exponentiation operator. Math.pow(2, exponent) expresses the same power calculation in a more compatible form.
Where do I edit a calculated field's JavaScript?
In Acrobat, open Prepare a Form, right-click the destination field, and choose Properties. On the Calculate tab, select Custom calculation script and click Edit.
What should I check if the result is still blank?
Confirm that MEASURE1 and TEMP1 exactly match the source field names and contain numeric values. Also check Preferences > Forms to make sure automatic calculation is enabled.
Does the order of calculated fields matter?
Yes. If a source field is also calculated, it should be calculated before the destination field. In Prepare a Form, use More > Set Field Calculation Order to review the sequence.




