PDF Editing Issues

How to Enable Dependent Checkboxes Based on a Main Checkbox in PDF Forms

Amos GikundaAmos Gikunda Nov 3, 2026 869 views

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.

How to Enable Dependent Checkboxes When a Main Checkbox is Selected in PDFs
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.
Before you start

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.

Solution 1Recommended

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.

1
Name the secondary checkboxes correctly

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').

2
Open properties for the primary checkbox

Right-click the main checkbox (e.g., named 'MainCheck') that will control the others, and select 'Properties'.

3
Add a JavaScript action

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.

4
Enter the control script

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.

Use a JavaScript Action on the Primary Checkbox
Understanding the Script: The script checks if the main checkbox is unchecked ('Off'). If it is 'Off', the readOnly state of 'DependentGroup' becomes true. If checked, readOnly becomes false, allowing user input.
Advanced PDF Form Editing

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. 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. 2. Insert Form Fields: Select 'Check Box' from the interactive controls menu and click anywhere on your document to place it.
  3. 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.
Intuitive Form Builder for seamlessly adding checkboxes, text fields, and interactive buttons.Fully compatible with standard PDF forms and Adobe Acrobat formats.Cost-effective and lightweight alternative to heavy PDF software.Advanced PDF editing capabilities including text modifications, e-signatures, and annotations.
microsoft office alternative - wps office

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.