Let Users Override a Calculated PDF Text Field in Adobe Acrobat
Question details
Allow users to edit an automatically populated PDF text field while recalculating it when either source field changes.

- Product
- Adobe Acrobat Pro PDF forms
- Device & OS
- not provided
- Scenario
- A PDF form combines values from two source fields into a third field that users can also edit manually.
- Observed behavior
- Manual edits should remain until a source field changes, at which point the calculated value should replace the manual entry.
Open the PDF in Adobe Acrobat Pro and check the exact names of the two source fields and the destination field in Prepare a form. Make sure the destination field is not marked Read Only.
Add a conditional calculation script to the destination field
Use this method when a manual override should remain until either source field changes.
In Adobe Acrobat Pro, open the PDF and select All tools > Prepare a form.
Double-click the destination field, named Text 2 in this example. On the General tab, make sure Read Only is unchecked.
Select the Calculate tab, choose Custom calculation script, and click Edit. Enter: if (event.source && (event.source.name == "Text A" || event.source.name == "Text B")) { event.value = this.getField("Text A").valueAsString + " " + this.getField("Text B").valueAsString; }
In the script editor, replace Text A and Text B with the exact names of your source fields if they differ, then confirm and close the field properties.
Save the PDF, exit form editing, and change a source field. Manually edit Text 2, then change either source field again to confirm that the calculated value replaces the manual entry.

Edit PDF Documents and Office Files with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Microsoft Office files. Open existing documents for an easy transition, but use Acrobat to create and test the form calculation script described above.

Frequently Asked Questions
Will a manual edit be overwritten when a source field changes?
Yes. The script recalculates Text 2 when Text A or Text B changes, replacing any manual value with the combined source values.
Why can't users type in the calculated field?
In Acrobat, open All tools > Prepare a form, double-click the destination field, and check that Read Only is not selected on the General tab.
What if my source fields have different names?
Replace each occurrence of Text A and Text B in the custom calculation script with the exact names shown in Prepare a form.
Why does the calculation work in Acrobat but not in a browser?
Some browser PDF viewers do not support Acrobat form JavaScript. Open the saved form in Adobe Acrobat or Acrobat Reader to test the calculation.




