PDF Editing Issues

How to Use One Checkbox to Select and Lock Multiple Checkboxes in PDF

Maira MehtabMaira Mehtab Nov 5, 2026 870 views

Question details

The user needs to create a master checkbox in a PDF that selects multiple individual checkboxes and makes them read-only when checked, and unchecks and makes them editable again when cleared.

How to Use One Checkbox to Select and Lock Multiple Checkboxes in PDF
Product
PDF Editor
Device & OS
not provided
Scenario
Creating advanced interactive PDF forms where certain options depend on a primary master selection.
Observed behavior
Requires a method to programmatically control the checked state and read-only status of multiple target checkboxes from a single master checkbox.
Before you start

Ensure your PDF editor supports JavaScript for form fields, as this interaction requires adding a custom script to the checkbox properties.

Solution 1Recommended

Add a JavaScript Action to the Master Checkbox

Use a custom JavaScript triggered by a 'Mouse Up' action to control the value and read-only state of target checkboxes.

By applying a small snippet of JavaScript to the master checkbox, you can dynamically update the properties of other form fields when the user interacts with it.

1
Open checkbox properties

Open form editing mode in your PDF editor, right-click the master checkbox, and select 'Properties'.

2
Set the trigger action

Navigate to the 'Actions' tab, select 'Mouse Up' from the Select Trigger dropdown, and choose 'Run a JavaScript' from the Select Action dropdown.

3
Add the JavaScript

Click 'Add' and enter the script to modify the target field. For example: getField("CheckBox1").readonly = true; to lock it. You will need to wrap this in an if/else statement based on the master checkbox state to toggle it on and off.

4
Test the form

Save your script, exit form editing mode, and click the master checkbox to ensure it correctly selects and locks the individual checkboxes.

Add a JavaScript Action to the Master Checkbox
Trigger Selection: Always use 'Mouse Up' rather than 'Mouse Down' so the script runs after the checkbox state has officially registered as changed.
Efficient PDF Form Creation

Create and Manage Interactive PDF Forms with WPS Office

WPS Office provides comprehensive PDF editing tools, allowing you to easily add, manage, and configure form fields, checkboxes, and interactive elements with ease.

  1. 1. Open the PDF: Launch WPS Office and open your PDF document.
  2. 2. Access form tools: Navigate to the 'Form' tab in the top ribbon to reveal all interactive form controls.
  3. 3. Insert checkboxes: Select 'Check Box' and click on the document area where you want to place your form controls.
  4. 4. Edit properties: Double-click the inserted checkbox to modify its properties, set export values, and configure custom actions.
Easily insert, align, and manage checkboxes and text fields.Fully compatible with standard Adobe PDF form features and field properties.Intuitive interface for managing form actions and interactive controls.Lightweight and fast PDF rendering across multiple devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my JavaScript action working on the PDF checkbox?

Ensure you have selected 'Mouse Up' as the trigger. If you use 'Mouse Down', the script runs before the checkbox state actually changes. Additionally, check that the field names in your script perfectly match the actual names of your checkboxes, as they are case-sensitive.

Can I make text fields read-only using the same JavaScript method?

Yes, the exact same JavaScript property (getField("FieldName").readonly = true;) applies to text fields, dropdown menus, and other form controls within a PDF document.

Will this master checkbox feature work if users open the PDF in a web browser?

Many built-in web browser PDF viewers have limited or no support for JavaScript. For interactive forms with custom scripts to work reliably, advise users to open the document in a dedicated PDF application like WPS Office or Adobe Acrobat.