How to Make a Calculated PDF Form Field Accept Manual Input
Question details
The user wants to allow manual data entry into a PDF form field that is normally locked for automatic calculations.

- Product
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF form where users might need to override an automatically calculated total or value manually.
- Observed behavior
- By default, calculated PDF fields receive their values exclusively from calculation scripts, preventing users from directly typing in their own values.
Ensure you have access to a PDF editor that supports form field creation and JavaScript execution. Verify and note down the exact names of your existing form fields before applying custom scripts, as the code is case-sensitive.
Use a Checkbox to Toggle the Custom Calculation Script
Add a custom JavaScript calculation script that checks the status of a checkbox to determine whether to run the calculation or allow manual input.
A calculated field usually updates automatically whenever related fields are changed, locking out manual input. By introducing a checkbox, you can set a condition in your custom calculation script: if the box is checked, perform the math; if it is unchecked, bypass the script so the user can type freely.
Insert a checkbox field into your PDF form. Right-click it, select 'Properties', navigate to the 'General' tab, and assign it an exact name (e.g., 'ManualOverride').
Right-click the calculated text field you want to modify, select 'Properties', and navigate to the 'Calculate' tab.
Choose the 'Custom calculation script' option and click 'Edit'. Enter the following script: if (this.getField("ManualOverride").valueAsString != "Off") { event.value = [Your Calculation Code]; }
Save the script, close the properties dialog, and exit form editing mode. Check the box to enable automatic calculation, or uncheck it to freely type a manual value into the calculated field.

Edit and Build PDF Forms Easily with WPS Office
WPS Office provides robust PDF editing tools, allowing you to insert text fields, checkboxes, and customize form properties without hassle. Whether you are creating a simple invoice or a complex calculated form, WPS PDF makes the process intuitive and efficient.
- 1. Open WPS PDF: Launch WPS Office and open your PDF document using the PDF editor.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access interactive field options like Text Field, Check Box, and Dropdown.
- 3. Edit Properties: Double-click any field to open its properties panel, where you can set formatting, options, and calculation logic.

Frequently Asked Questions
Why is my custom PDF calculation script returning an error?
A common reason is incorrect field names in the script. PDF JavaScript is case-sensitive, so ensure the field names referenced in this.getField("FieldName") exactly match the names defined in your form's field properties.
Can I use a dropdown menu instead of a checkbox to control manual input?
Yes, you can evaluate the value of a dropdown list in your calculation script. Simply replace the checkbox field name in your script with the dropdown's name, and check against its specific selection value (e.g., if the value equals 'Auto').
Will my manual inputs be overwritten if the calculation triggers again?
As long as the custom script is configured to only assign event.value when the checkbox is checked, unchecking the box will prevent the script from overwriting the field. This safely preserves whatever manual input you type.




