PDF Editing Issues

Fix an Acrobat Calculated Field That Does Not Display a JavaScript Result

John WilsonJohn Wilson Nov 19, 2026 869 views

Question details

The user needs an Acrobat calculated field to display a corrected value based on two other form fields.

Fix an Acrobat Calculated Field That Does Not Display a JavaScript Result
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.
Before you start

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.

Solution 1Recommended

Replace the exponentiation operator with Math.pow()

Use this calculation when the Acrobat JavaScript engine may not support the double-asterisk exponentiation operator.

1
Open the calculation script

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.

2
Update the formula

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));

3
Check and test the fields

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.

Replace the exponentiation operator with Math.pow()
Check the field names: The names in getField() must exactly match the form field names. The script converts values to numbers; test with populated numeric fields rather than blank entries.
Free Microsoft Office alternative

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.

Open and work with PDF documents alongside other office filesCompatible with Microsoft Office formats including DOCX, XLSX, and PPTXUse a familiar interface that makes moving from Microsoft Office easierKeep document, spreadsheet, and presentation tools in one lightweight suite
microsoft office alternative - wps office

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.