Allow Manual Overrides for Calculated Form Fields in Adobe Acrobat
Question details
Allow users to manually edit an account-number field after Acrobat automatically populates it based on the selected manufacturer.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form uses a manufacturer field to assign an account number, but users also need to enter or correct the number manually.
- Observed behavior
- A calculation on the account-number field can overwrite a user's manual input.
Open the form in Adobe Acrobat and check the exact names of the manufacturer and account-number fields in Prepare a form. Confirm that you can edit the form's field properties and that JavaScript is enabled.
Move the calculation to the manufacturer field's validation script
Use this approach to populate the account number when the manufacturer changes while allowing users to edit the account number afterward.
The source field's validation script reads the selected manufacturer from event.value and writes the matching result to the account-number field. A later change to the manufacturer can overwrite a manual account number.
In Adobe Acrobat, open the PDF and select All tools > Prepare a form. Locate the fields named OS Product Manufacturer.1 and OSAccount Number.
Open Properties for OSAccount Number, select the Calculate tab, and remove the calculation script that overwrites manual input. On the General tab, make sure Read Only is not selected.
Open Properties for OS Product Manufacturer.1, select the Validate tab, choose Run custom validation script, and click Edit. For the supplied example, enter: var fieldA = this.getField("OSAccount Number"); if (event.value === "Alden Optical") fieldA.value = "1";
In the script editor, replace the example manufacturer and account number with the values used by your form, and add conditions for any other manufacturers. Keep the target field name exactly as shown in its Properties.
Save the script and PDF, exit Prepare a form, and select a manufacturer. After the account number is populated, type a different value into OSAccount Number and confirm it remains until the manufacturer is changed again.

Fill PDF forms and work with Office files in WPS Office
WPS Office is a free, lightweight alternative for everyday document and PDF work, with a familiar interface and support for common Office formats to make migration easier. It does not fix Acrobat's calculation script; test your PDF's interactive fields and JavaScript behavior before relying on it.

Frequently Asked Questions
Why does my manual account number get replaced?
A calculation script on the account-number field may recalculate its value. In Prepare a form, open the field's Properties and check the Calculate tab for a script that writes the value.
Will changing the manufacturer overwrite a manual entry?
It can. The manufacturer field's validation script assigns a new account number when the selected value matches a condition, so a later manufacturer change can replace the manual entry.
What does event.value represent in the validation script?
In the manufacturer field's validation script, event.value is the value being validated for that field. Compare it with each manufacturer value to decide which account number to assign.
Why can't I type in the account-number field?
In Prepare a form, open the account-number field's Properties and check that Read Only is not selected on the General tab. Also check whether another script is resetting the field.




