How to Remove a Score Calculation When an Acrobat PDF Checkbox is Unchecked
Question details
The user needs to reset a dependent numeric field so that a calculated score is properly removed from the final total when a controlling checkbox is unchecked in a PDF form.

- Product
- Adobe Acrobat / PDF Forms
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF form with custom numeric calculations tied to checkboxes.
- Observed behavior
- The calculated score remains in the final total even after the controlling checkbox is cleared by the user.
Ensure you have access to the PDF form editing tools and know the exact internal field name of the dependent numeric field you want to reset.
Use Custom JavaScript on a Mouse Up Action
Add a custom script to the checkbox properties to clear the dependent field's value immediately when the checkbox is turned off.
By default, PDF form fields do not automatically clear their dependent values just because a controlling checkbox is toggled. You must define a specific action using JavaScript to explicitly reset the dependent field back to blank or zero.
Open your PDF form in editing mode. Right-click the target checkbox that controls the score and select 'Properties' from the context menu.
Navigate to the 'Actions' tab. From the 'Select Trigger' dropdown menu, select 'Mouse Up'.
Choose 'Run a JavaScript' from the 'Select Action' dropdown and click 'Add'. In the script editor, enter the following code: if (event.target.value == "Off") { var f = this.getField("YourField"); if (f) f.value = ""; }
Replace 'YourField' in the provided script with the exact name of your dependent numeric field. Click 'OK' to save the script, then close the properties dialog.

Easily Manage Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to view, fill, and manage interactive PDF forms effortlessly. Handle document formatting, fillable fields, and text edits within one lightweight application.
- 1. Open PDF Editor: Launch WPS Office and open your PDF document using the WPS PDF Editor tool.
- 2. Access Form Tools: Navigate to the 'Form' or 'Edit' tab on the top ribbon to view all interactive fields and properties.
- 3. Edit and Save: Make your necessary adjustments to the interactive properties, then click 'Save' to apply your new settings.

Frequently Asked Questions
Why does my PDF calculation not update immediately?
Calculations in PDF forms often require a specific event trigger, such as a 'Mouse Up' action or losing focus on a field. Ensuring your script is tied to the correct trigger helps the form update the total in real time.
What is the 'Off' value for a PDF checkbox?
In standard PDF forms, an unchecked checkbox typically has the export value of 'Off'. When checking states in JavaScript, comparing the event target value to 'Off' accurately detects when the box is cleared.
Can I reset multiple fields with one checkbox?
Yes. You can add multiple field assignment lines within the same JavaScript block to clear out or reset several dependent numeric fields simultaneously when the checkbox is unchecked.




