How to Allow Users to Override a Calculated PDF Form Field
Question details
The user wants to allow manual input in a specific calculated PDF form field without breaking the overall correct column totals.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating or editing a fillable PDF form that requires both calculated row values and column totals, alongside occasional manual adjustments.
- Observed behavior
- Default calculated fields automatically overwrite manually entered values, preventing users from making necessary manual adjustments.
Ensure your PDF editing software supports interactive form field properties and custom JavaScript for calculations. Save a backup of your current PDF form before modifying scripts.
Implement an Override Field with Custom JavaScript
Create a separate override field and use a calculation script that relies on the override value when it is not empty, falling back to the automatic calculation otherwise.
Because default calculation settings in PDF forms automatically overwrite any manual input, the best approach is to use conditional JavaScript. This method involves creating a dedicated field for manual entry and a separate hidden field that performs the logic to choose between the manual input and the standard calculation.
Add a new text field next to the target row, naming it appropriately (e.g., 'Row1_Override'). Keep this field visible to the user so they can enter their manual values.
Create the field that will show the final calculated or overridden value (e.g., 'Row1_Final'). Right-click the field, select 'Properties', and navigate to the 'Calculate' tab.
Choose the 'Custom calculation script' option and enter a JavaScript snippet that checks the override field. For example: `var over = getField('Row1_Override').value; if(over !== '') { event.value = over; } else { event.value = [your normal calculation]; }`.
Select your column total field, go to its calculation properties, and ensure it sums up the 'Row1_Final' fields rather than the original raw inputs. This guarantees the override values are included in the final sum.

Create and Edit Advanced PDF Forms with WPS Office
WPS Office provides robust PDF editing tools, allowing you to easily design fillable forms, insert text fields, and manage form properties to streamline data collection and calculations.
- 1. Open your PDF: Launch WPS Office and open your PDF document using the built-in PDF editor.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all available form controls and editing options.
- 3. Add Text Fields: Click 'Text Field' and click on the page to insert fields for manual overrides or calculated totals.
- 4. Edit Properties: Double-click the inserted form field to open the Properties dialog, where you can customize its appearance, format, and calculation behavior.

Frequently Asked Questions
Why does my manually entered value disappear in a calculated PDF field?
In interactive PDF forms, fields set to calculate automatically run their scripts or formulas whenever any data in the document changes. This forces the calculated field to update immediately, overwriting any manual input you just typed.
Can I just turn off automatic calculation temporarily?
Yes, in most advanced PDF editors you can disable automatic calculation in the application preferences. However, this affects the entire document and application, making it an impractical solution for end-users who need the rest of the form to calculate correctly.
Do I need to know JavaScript to create an override field?
Yes, achieving a conditional override—where the form intelligently chooses between a calculated value and a manual value—requires adding a simple custom JavaScript snippet within the field's calculation properties.




