How to Override a Calculated Form Field with Manual Input in Acrobat
Question details
The user needs a way to combine separate input fields into a calculated full-name field in a PDF form while still allowing users to manually override the result without it being automatically erased.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or modifying an interactive PDF form with dynamic calculated fields.
- Observed behavior
- By default, calculated fields continuously evaluate and overwrite any manual input. The goal is to make the manual input persist unless the original source fields are explicitly edited again.
Ensure you have access to the 'Prepare Form' tool in Adobe Acrobat and that you know the exact names of the source fields you want to combine.
Update the Custom Calculation Script
Modify the calculation script to check the event source, ensuring it only generates the combined string when the specific source fields trigger the event.
Standard calculated fields evaluate constantly, which causes them to immediately erase any manual overrides. By checking 'event.source.name', you restrict the calculation so it only triggers when the individual name fields are edited. This allows a manually typed full name to remain intact.
Open your PDF in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form'.
Right-click on the calculated target field (e.g., the Full Name field) and choose 'Properties'.
Go to the 'Calculate' tab and select the 'Custom calculation script' radio button.
Click 'Edit' and enter the following script, replacing the field names with your exact field names: if (event.source && (event.source.name == "Patient First Name" || event.source.name == "Patient Middle Initial" || event.source.name == "Patient Last Name")) event.value = this.getField("Patient First Name").value + " " + this.getField("Patient Middle Initial").value + " " + this.getField("Patient Last Name").value;
Click 'OK' to save the script, close the properties dialog, and test the form by filling out the source fields and then attempting a manual override.

Edit PDFs and Manage Forms Easily with WPS Office
While complex JavaScript programming requires specialized PDF developer tools, WPS Office provides a lightweight, intuitive, and highly compatible PDF editor for everyday document workflows. Read, edit, fill out forms, and manage your PDFs seamlessly alongside your standard office documents.

Frequently Asked Questions
Can I use standard math calculations and still allow manual overrides?
Using predefined calculation options (like 'Value is the sum of') will constantly recalculate. To allow manual overrides for math functions, you must also use a custom calculation script that checks the event source.
Why doesn't the script work when I preview the form?
Ensure that the field names in your JavaScript perfectly match the actual names of your form fields, including spaces and capitalization. Also, verify that JavaScript is enabled in Acrobat's preferences.
How can I prevent the script from overwriting a manual entry entirely?
You would need to write a more complex script that checks if the target field has already been manually modified, potentially by storing a flag or comparing the current value against the expected calculated value, though this is significantly more advanced.




