Fix Adobe Acrobat Form Fields That Do Not Mirror Values
Question details
The user needs an Acrobat form field to display the value of another field using JavaScript.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A destination field uses a calculation script to copy the value entered in a source field.
- Observed behavior
- The destination field remains blank, potentially because the script uses an incorrect field name or has not recalculated.
Open the PDF in Adobe Acrobat and identify both the source field and the destination field. Make sure you can access the form editing tools and the destination field's properties.
Check the Field Name and Calculation Script in Acrobat
Use this method when a destination field stays blank while copying another field's value.
Open Prepare a Form, right-click the source field, and select Properties. On the General tab, note the Name exactly, including capitalization.
Right-click the destination field, select Properties, and open the Calculate tab. Select Custom calculation script and click Edit.
In the script editor, use the exact source field name with getField(). For a field named ProdTime, enter: event.value = this.getField("ProdTime").valueAsString;
Close the properties and form editor, change the source field, and commit the entry by moving focus to another field. Check whether the destination field displays the value.
If the field is still blank, open Preferences and check that Acrobat JavaScript is enabled under JavaScript and automatic field calculation is enabled under Forms. Open the JavaScript console to look for errors; on Windows, press Ctrl+J.

Work With PDFs and Office Files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its compatibility with common Office formats makes moving existing files straightforward. Use Acrobat to troubleshoot the Acrobat JavaScript calculation; script behavior may differ in other PDF applications.

Frequently Asked Questions
Why does getField() fail to find my source field?
The field name may be misspelled or have different capitalization. In Prepare a Form, open the source field's Properties and copy the exact Name from the General tab into getField().
Where should I put the script that copies the value?
Open the destination field's Properties, select the Calculate tab, and edit its Custom calculation script. Assign the source value to event.value.
Why does the destination field update only after I leave the source field?
A calculation may run when a field change is committed. After entering a value, move focus to another field and check the destination. Also check the automatic calculation setting under Preferences > Forms.
How can I find a JavaScript error in Acrobat?
Open Acrobat's JavaScript console and inspect any errors after changing the source field. On Windows, press Ctrl+J to open the console.




