PDF Editing Issues

How to Allow Manual Text Entry After a PDF Calculation

Maira MehtabMaira Mehtab Oct 28, 2026 869 views

Question details

The user needs a PDF text field to automatically display 'N/A' when a Yes checkbox is selected, but still allow custom manual text entry without the calculation script continuously overwriting the input.

How to Allow Manual Text Entry After a PDF Calculation
Product
PDF Forms
Device & OS
not provided
Scenario
Creating an interactive PDF form where text fields conditionally auto-fill based on checkboxes but must remain manually editable.
Observed behavior
A calculation script runs whenever the form recalculates, constantly overriding and replacing any custom manual entries the user types.
Before you start

Ensure you have access to advanced form editing tools and the JavaScript console in your PDF editor to modify field properties and behaviors.

Solution 1Recommended

Control Script Execution Using event.rc

Modify your custom calculation script to stop running when certain conditions are met, preventing it from constantly overwriting manual input.

A calculation script naturally runs whenever any part of the form recalculates. This causes it to replace manual input. By setting event.rc to false under specific conditions, you selectively prevent the calculation from committing its result, leaving the user's manual input intact.

1
Open Field Properties

Enter form editing mode in your PDF editor. Right-click the target text field that receives the calculation and select 'Properties'.

2
Access the Calculate Tab

Navigate to the 'Calculate' tab and ensure 'Custom calculation script' is selected. Click the 'Edit' button to modify the script.

3
Modify the Custom Script

Enter your JavaScript to assign the 'N/A' value, then add a condition to control the event using event.rc. For example: event.value = 'N/A'; event.rc = (this.getField('Perform').value == 'Yes');

4
Apply and Test

Click 'OK' to save the script, close the properties dialog, and exit form editing mode to test if the field now accepts manual edits when the condition is not met.

Control Script Execution Using event.rc
Optional Read-Only Property: You might also consider adding a line to set the field's readOnly property to true so that the user cannot place the cursor in the field when 'Yes' is selected.

Effortlessly Edit and Fill PDF Forms with WPS Office

WPS Office provides a comprehensive suite of PDF tools, allowing you to easily view, fill, and manage interactive PDF forms securely and quickly.

  1. 1. Download and Install: Download WPS Office Free from the official website and install it on your device.
  2. 2. Open Your PDF Form: Launch WPS Office and drag and drop your interactive PDF form directly into the application workspace.
  3. 3. Fill and Edit Fields: Navigate through the document and click directly on text fields, checkboxes, and dropdowns to input your data easily.
  4. 4. Save and Export: Once completed, click 'Save' or use the export options to share your finalized PDF securely.
Seamless compatibility with standard PDF forms and Microsoft Office document formatsLightweight architecture that opens large and complex PDFs instantlyIntuitive user interface for easily filling out, saving, and printing interactive form fieldsBuilt-in PDF editing tools for text, images, and page management
microsoft office alternative - wps office

Frequently Asked Questions

Why does my calculation script overwrite manual entry in Acrobat?

Calculation scripts trigger every time any form field in the document is updated (a recalculation event). If the script doesn't have a programmed condition to stop executing, it will constantly reapply its default calculation, overriding whatever text you just typed.

Can I conditionally make a PDF field read-only?

Yes. You can use JavaScript in your PDF form to set the field property to read-only based on user actions. For example, adding 'this.getField("FieldName").readonly = true;' when a specific checkbox is selected prevents manual entry entirely.

How do I insert text only if the PDF field is empty?

You can add an 'If' condition in your JavaScript trigger to check the current value before applying a new one. Using a statement like 'if (this.getField("FieldName").value == "")' ensures that you only insert 'N/A' if the user hasn't already typed a custom response.