Override Calculated Form Fields in Adobe Acrobat Pro
Question details
Allow users to enter manual values in calculated PDF form fields and return to the original formulas using a checkbox.

- Product
- Adobe Acrobat Pro 2017
- Device & OS
- not provided
- Scenario
- A PDF form has calculated fields that users sometimes need to override manually.
- Observed behavior
- The desired form lets users switch between manual entry and calculated results without removing the calculation scripts.
Open the PDF in Acrobat Pro and choose Tools > Prepare Form. Identify the exact names of the checkbox, calculated fields, and fields used in each formula.
Use a checkbox to switch between manual and calculated values
Use this approach when a checkbox should enable manual entry and restore the calculation when cleared.
The example uses a checkbox named Override, a calculated field named Total, and source fields named Quantity and UnitPrice. Replace those names and the example formula with the ones in your form.
Keep the formula in the field's custom calculation script. The script assigns the current field value when override is enabled and the formula result when it is disabled.
In Tools > Prepare Form, add a checkbox named Override or open the existing checkbox's Properties to confirm its name and export value. Open the Total field's Properties and select Read Only so it starts locked when the checkbox is unchecked.
Open Total Properties > Calculate, select Custom calculation script, and click Edit. Enter: var override = this.getField("Override").value !== "Off"; var total = this.getField("Total"); if (override) { event.value = total.value; } else { event.value = (Number(this.getField("Quantity").value) || 0) * (Number(this.getField("UnitPrice").value) || 0); }
Open Override Properties > Actions. Select Mouse Up as the trigger and Run a JavaScript as the action, then click Add. Enter: var manual = this.getField("Override").value !== "Off"; this.getField("Total").readonly = !manual; this.calculateNow();
Close Prepare Form, check Override, and enter a value in Total. Change a source field to verify the manual value remains. Clear Override and confirm Total becomes read-only and recalculates from Quantity and UnitPrice.

Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight, easy-to-use alternative for everyday document work, with a familiar interface and support for common Office formats to make migration straightforward. Acrobat-specific form calculation scripts should be configured and tested in Acrobat.

Frequently Asked Questions
Why does the checkbox script use "Off" instead of "off"?
Acrobat commonly returns the case-sensitive value "Off" when a checkbox is unchecked. Check the checkbox's Properties and use the values defined for your form.
Can I restore a formula by commenting it out?
No. Acrobat will not automatically restore a commented-out formula. Keep the formula in the field's custom calculation script and use a condition to select the manual or calculated value.
Where do I put the calculation script?
In Tools > Prepare Form, open the calculated field's Properties, select Calculate > Custom calculation script, and click Edit.
How do I apply the override to more than one field?
Add conditional calculation logic to each field's Calculate action. In the checkbox's Mouse Up JavaScript, set the readonly property for each affected field, then call this.calculateNow(). Test each field in both modes.




