How to Make a PDF Checkbox Conditional on Other Checkboxes
Question details
The user needs to configure a PDF form checkbox so that its state automatically changes based on whether two or more prerequisite checkboxes are selected.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating advanced interactive PDF forms that require logic-based field dependencies.
- Observed behavior
- Requires implementing JavaScript logic using the getField method and comparison operators to dynamically control the dependent checkbox states.
Ensure you are using a PDF editor that supports JavaScript form calculations and that all your prerequisite and dependent checkboxes have exact, unique field names assigned in their properties.
Use a Custom Calculation Script to Control Dependencies
Use JavaScript to explicitly retrieve the values of the prerequisite checkboxes and apply conditional logic to set the dependent checkbox state.
In Adobe Acrobat, a dependent checkbox can automatically check or uncheck itself by monitoring the states of other fields. This requires adding a custom calculation script to the dependent checkbox.
The standard export value for an unchecked box is 'Off', while a checked box typically returns 'Yes' or a custom export value you defined.
Open your PDF form in Adobe Acrobat and select the 'Prepare Form' tool from the right-hand pane to make the fields editable.
Right-click on the dependent checkbox (the one you want to be controlled automatically) and choose 'Properties' from the context menu.
Navigate to the 'Calculate' tab, select 'Custom calculation script', and click the 'Edit' button to open the JavaScript editor.
Input the script to test the prerequisites. For example: var cb3 = this.getField("CB3").value; var cb4 = this.getField("CB4").value; if (cb3 !== "Off" && cb4 !== "Off") { event.value = "Yes"; } else { event.value = "Off"; }
Click 'OK' to close the editor, then 'Close' on the Properties window. Click 'Preview' at the top right to test checking and unchecking the prerequisite boxes to see the dependent box react.

Create and Manage Interactive PDF Forms with WPS Office
Easily design, edit, and fill interactive PDF forms using WPS Office. Whether you are adding text fields, checkboxes, or dropdown menus, WPS provides a highly compatible and intuitive interface for all your document needs.
- 1. Open your PDF: Launch WPS Office and open your target PDF file within the PDF editing module.
- 2. Access form tools: Navigate to the 'Form' tab on the top ribbon to view all interactive form creation tools.
- 3. Insert checkboxes: Click on the 'Check Box' tool and click anywhere on your document to insert a new checkbox field.
- 4. Configure properties: Double-click the newly inserted checkbox to customize its appearance, field name, and export values.

Frequently Asked Questions
Why isn't my PDF custom calculation script updating the checkbox?
Your script may fail to update if the field names in your JavaScript don't perfectly match the names assigned in the form's properties (names are case-sensitive). Additionally, ensure the field calculation order under the 'Prepare Form' menu isn't preventing the script from running in the correct sequence.
What is the default export value of a checked PDF checkbox?
By default, an unchecked box returns the value 'Off'. A checked box typically returns 'Yes', unless you have specified a custom export value in the 'Options' tab of the Checkbox Properties.
Can I make a text field conditionally required based on a checkbox?
Yes. You can add a custom JavaScript action to the checkbox's 'Mouse Up' event that sets this.getField("Text1").required = true when checked, and false when unchecked.
Does WPS Office support creating PDF checkboxes?
Yes, WPS Office Pro includes comprehensive PDF form building features. You can easily insert interactive form fields like checkboxes, text fields, radio buttons, and dropdown lists directly from the 'Form' tab.




