PDF Editing Issues

Let Users Override a Calculated PDF Text Field in Adobe Acrobat

Muhammad TalhaMuhammad Talha Nov 19, 2026 869 views

Question details

Allow users to edit an automatically populated PDF text field while recalculating it when either source field changes.

Let Users Override a Calculated PDF Text Field in Adobe Acrobat
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.
Before you start

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.

Solution 1Recommended

Add a conditional calculation script to the destination field

Use this method when a manual override should remain until either source field changes.

1
Open the form editor

In Adobe Acrobat Pro, open the PDF and select All tools > Prepare a form.

2
Open field properties

Double-click the destination field, named Text 2 in this example. On the General tab, make sure Read Only is unchecked.

3
Enter the calculation script

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

4
Match your field names

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.

5
Test the override

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.

Add a conditional calculation script to the destination field
PDF viewer support: The calculation requires a PDF viewer that supports Acrobat form JavaScript. Test the saved form in Adobe Acrobat or Acrobat Reader; browser PDF viewers may not run the script.
Free Microsoft Office alternative

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.

View and edit PDF documents in a familiar workspaceCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXOpen existing Office files without switching between separate appsUse a free, lightweight suite for everyday document work
microsoft office alternative - wps office

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.