How to Enable Dependent Checkboxes Based on a Main Checkbox in PDF Forms
Question details
The user needs to enable a group of mutually exclusive checkboxes only after a primary main checkbox is checked in an interactive PDF form.

- Product
- Adobe Acrobat / PDF Form Editors
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where secondary options should remain restricted until a primary prerequisite option is selected.
- Observed behavior
- The secondary checkboxes are currently freely clickable, whereas the goal is to make them read-only until the main checkbox is explicitly selected by the user.
Ensure you are using a professional PDF editor that supports JavaScript for form fields, and that your PDF is currently open in Form Editing or Prepare Form mode.
Use a JavaScript Action on the Primary Checkbox
By configuring a simple Mouse Up JavaScript action on the main checkbox, you can dynamically control the read-only property of the secondary checkbox group.
To make multiple checkboxes act as a mutually exclusive group, they must share the exact same field name but have different export values. Once grouped, you can use a script on the main checkbox to toggle their interactivity.
Right-click your secondary checkboxes and open their Properties. Give all of them the exact same name (e.g., 'DependentGroup'). Go to the Options tab and ensure each one has a unique Export Value (e.g., 'Choice1', 'Choice2', 'Choice3').
Right-click the main checkbox (e.g., named 'MainCheck') that will control the others, and select 'Properties'.
Navigate to the 'Actions' tab. Select 'Mouse Up' as the Trigger. From the Select Action dropdown, choose 'Run a JavaScript', and then click the 'Add' button.
In the JavaScript Editor window, paste the following code: this.getField("DependentGroup").readOnly = (event.target.value == "Off"); Click OK, then close the properties window. Test your form by switching to Preview mode.

Easily Create Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive suite of PDF form editing tools, allowing you to insert checkboxes, manage field properties, and design smart interactive documents with ease.
- 1. Open the PDF in WPS Office: Launch WPS Office, open your PDF document, and navigate to the 'Form' tab in the top ribbon.
- 2. Insert Form Fields: Select 'Check Box' from the interactive controls menu and click anywhere on your document to place it.
- 3. Configure Properties: Double-click the newly created checkbox to open its Properties dialog, where you can modify its name, set export values, and define interactions.

Frequently Asked Questions
Why do all my checkboxes get checked at the same time?
If your checkboxes share the same field name and the exact same export value, checking one will automatically mirror the action to the others. To make them mutually exclusive (like radio buttons), ensure they share the same name but have distinct, unique export values.
Can I hide the dependent checkboxes entirely instead of making them read-only?
Yes. Instead of modifying the 'readOnly' property, you can alter the 'display' property in your JavaScript. Use this code: this.getField('DependentGroup').display = (event.target.value == 'Off') ? display.hidden : display.visible;
Will this JavaScript functionality work in all PDF viewers?
Form field JavaScript works flawlessly in robust PDF readers like Adobe Acrobat, WPS Office, and Foxit. However, some basic browser-based PDF viewers or native mobile preview apps may not fully support interactive scripts, causing the checkboxes to remain enabled.




