PDF Editing Issues

How to Make a Calculated PDF Form Field Accept Manual Input

Olivia MillerOlivia Miller Nov 3, 2026 868 views

Question details

The user wants to allow manual data entry into a PDF form field that is normally locked for automatic calculations.

How to Make a Calculated PDF Form Field Accept Manual Input
Product
PDF
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.
Before you start

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.

Solution 1Recommended

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.

1
Add a Checkbox Field

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').

2
Open Target Field Properties

Right-click the calculated text field you want to modify, select 'Properties', and navigate to the 'Calculate' tab.

3
Apply Custom Calculation Script

Choose the 'Custom calculation script' option and click 'Edit'. Enter the following script: if (this.getField("ManualOverride").valueAsString != "Off") { event.value = [Your Calculation Code]; }

4
Test the Form

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.

Use a Checkbox to Toggle the Custom Calculation Script
Script Customization: Make sure to replace '[Your Calculation Code]' with your actual JavaScript mathematical operations, and ensure 'ManualOverride' exactly matches the name of your checkbox field.
Create Interactive PDF Forms

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. 1. Open WPS PDF: Launch WPS Office and open your PDF document using the PDF editor.
  2. 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. 3. Edit Properties: Double-click any field to open its properties panel, where you can set formatting, options, and calculation logic.
Easily insert and customize interactive PDF form fieldsSupport for advanced form properties and calculationsHighly compatible with Adobe Acrobat PDF forms and standard PDF formatsLightweight, fast, and feature-rich PDF editor
microsoft office alternative - wps office

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.