How to Create a Checkbox Based on Multiple Selections in PDF Forms
Question details
The user wants to configure a read-only PDF checkbox to automatically check itself when any of several specific checkboxes are selected, and uncheck only when all of the source boxes are cleared.

- Product
- Adobe Acrobat PDF
- Device & OS
- not provided
- Scenario
- Creating dynamic PDF forms with interdependent checkbox logic for automated status tracking.
- Observed behavior
- Acrobat does not natively expose a calculation event directly on checkboxes, requiring a workaround to trigger the desired checkbox dependency.
Ensure you have access to a PDF editor that supports form creation and custom JavaScript execution, such as Adobe Acrobat Pro. Take note of the exact field names for all the checkboxes you intend to link, as JavaScript is case-sensitive.
Use a Hidden Text Field with a Custom Calculation Script
Since PDF checkboxes do not trigger calculation events directly, you can use a hidden text field to run the required JavaScript automatically when the form is updated.
Adobe Acrobat's PDF architecture does not allow you to attach a calculation script directly to a checkbox field. The most reliable workaround is to create a hidden text field that acts as a continuous trigger. This hidden field evaluates the status of the source checkboxes and updates the target read-only checkbox accordingly.
Open your PDF form in Acrobat and enter 'Prepare Form' mode. Ensure your read-only checkbox (e.g., 'AIR') and the source checkboxes (e.g., 'air freight', 'airway', 'aircraft') are already created and properly named. Set the 'AIR' checkbox to 'Read Only' in its Properties under the General tab.
Add a new Text Field to your form. Right-click it and select Properties. Under the General tab, change the 'Form Field' property to 'Hidden' so it will not appear on the final printed or viewed document.
Go to the Calculate tab in the hidden Text Field's properties. Select 'Custom calculation script' and click the 'Edit' button.
Paste the following script into the editor: var bIsSet = this.getField("air freight").isBoxChecked(0) || this.getField("airway").isBoxChecked(0) || this.getField("aircraft").isBoxChecked(0); this.getField("AIR").checkThisBox(0, bIsSet); Then, click OK and close the properties panel.
Exit 'Prepare Form' mode to return to regular viewing mode. Click on the source checkboxes to verify that the 'AIR' checkbox automatically selects when at least one is checked, and clears only when all three are unchecked.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides an intuitive and powerful PDF editor that allows you to easily insert checkboxes, text fields, and other form controls. It is highly compatible with standard PDF formats, offering a lightweight and cost-effective solution for handling document workflows.
- 1. Open your PDF document: Launch WPS Office and open the PDF file you want to add form controls to.
- 2. Access form tools: Navigate to the 'Form' tab located on the top ribbon of the PDF editor.
- 3. Insert a checkbox: Click on the 'Check Box' icon, then click and drag on the document to draw the checkbox at your desired location.
- 4. Configure checkbox properties: Double-click the newly created checkbox to adjust its properties, appearance, and export values to suit your document's needs.

Frequently Asked Questions
Why can't I add a calculation script directly to a checkbox in Acrobat?
Acrobat's PDF architecture does not expose calculation events for button-type fields like checkboxes or radio buttons. Calculation scripts can only be natively attached to text fields or dropdown menus, which is why a hidden text field is necessary as a trigger mechanism.
How do I make the dependent target checkbox read-only?
Open the target checkbox Properties, navigate to the General tab, and check the 'Read Only' option. This ensures users cannot manually check or uncheck the box, forcing it to rely entirely on the JavaScript logic running in the background.
Will this JavaScript calculation work on all PDF readers?
Advanced JavaScript calculations work perfectly in Adobe Acrobat and other full-featured PDF editors. However, some basic browsers or mobile PDF viewers might not fully support PDF JavaScript execution. It is highly recommended to test your form across different popular PDF readers if you plan to distribute it widely.




