PDF Editing Issues

How to Allow Manual Override of a Calculated PDF Form Field

Bushra ParveenBushra Parveen Nov 2, 2026 868 views

Question details

The user needs to configure a PDF form field to allow manual data entry while retaining its automatic calculation capability.

How to Allow Manual Override of a Calculated PDF Form Field
Product
PDF Forms
Device & OS
not provided
Scenario
Setting up a commission field in a PDF form that calculates automatically based on job total and percentage, but requires occasional manual adjustments.
Observed behavior
The field automatically calculates the value, which prevents the user from manually entering a custom commission amount when an override is needed.
Before you start

Ensure you have access to a PDF editor with form creation capabilities and basic knowledge of JavaScript for PDF calculations.

Solution 1Recommended

Use a Checkbox to Toggle Manual and Automatic Calculation

The most reliable method to override an automated calculation is by adding a checkbox that controls whether the field calculates automatically or accepts manual input.

Overriding a calculation directly can be tricky because the PDF needs to know exactly when to disable and enable the calculation script. By introducing a checkbox, you provide a clear trigger.

When the checkbox is checked, the field functions normally as a read-only calculated field. When cleared, the script disables the calculation, allowing the user to type freely.

1
Add a Checkbox Field

Open your PDF form editor and insert a new checkbox field next to your commission field. Label it something clear, such as 'Calculated Commission'.

2
Modify the Field Properties

Right-click the checkbox to access its Properties. Set its export value to 'Yes' or 'On', so you can reference its state in your calculation script.

3
Update the Calculation Script

Open the Properties of your commission text field and navigate to the Calculation tab. Edit your custom calculation script to check the status of the checkbox first.

4
Implement the Override Code

In your JavaScript, add a condition: if the checkbox is cleared, execute 'event.rc = false;'. This specific line of code tells the PDF viewer to disable the calculation for this event, allowing manual text entry.

5
Toggle the Read-Only State

Optionally, add a Mouse Up action to the checkbox that sets the commission field's Read-Only property to 'true' when checked, and 'false' when cleared. This prevents users from trying to type when auto-calculate is active.

Use a Checkbox to Toggle Manual and Automatic Calculation
Alternative Methods: While advanced scripts can detect manual keystrokes to turn off calculations automatically, a checkbox approach is much simpler to implement and provides a clearer user experience.
Edit PDF Forms Easily

Create and Manage Interactive PDF Forms with WPS Office

WPS Office provides an intuitive and powerful PDF editor that allows you to create interactive, fillable PDF forms with ease. Whether you need to insert checkboxes, text fields, or configure field properties, WPS PDF handles it effortlessly.

  1. 1. Open your PDF in WPS Office: Launch WPS Office, go to the PDF tab, and open the document you wish to convert into a fillable form.
  2. 2. Access Form Tools: Navigate to the 'Form' tab located on the top ribbon menu to access all available form editing tools.
  3. 3. Insert Form Fields: Select the 'Text Field' or 'Check Box' tool from the menu and click on your document to place the interactive elements.
  4. 4. Configure Field Properties: Double-click the inserted field to open the Properties menu, where you can set default values, formatting, and calculation rules.
Create interactive and fillable PDF forms without advanced codingFully compatible with standard Adobe PDF formats and form elementsEasily insert text fields, checkboxes, dropdowns, and buttonsLightweight, fast, and features a user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I manually type into my calculated PDF field?

If a text field has a calculation script applied in its properties, the PDF viewer will continuously execute that script and overwrite any manual input with the calculated result. You must conditionally disable the calculation script to allow manual entry.

What does event.rc = false do in a PDF calculation?

The 'event.rc = false' JavaScript statement rejects the calculation event. When this is triggered, the PDF stops updating the field's value based on the calculation, which frees the field to accept and retain manual user input.

Will these calculation scripts work on mobile PDF viewers?

Complex JavaScript calculations and conditional overrides work best on desktop PDF applications like WPS Office and Adobe Acrobat. Many built-in mobile PDF viewers or web browsers have limited support for JavaScript form calculations, which may cause the fields to behave unpredictably.