PDF Editing Issues

How to Automatically Select Related Checkboxes in a PDF Form

John WilsonJohn Wilson Oct 28, 2026 868 views

Question details

Configure a primary checkbox to automatically select or clear two or more dependent checkboxes in an interactive PDF form.

How to Automatically Select Related Checkboxes in a PDF Form
Product
PDF Form Editor
Device & OS
not provided
Scenario
Creating an interactive PDF form where user selections need to trigger conditional logic for other fields.
Observed behavior
The user wants to automate the form filling process by linking multiple checkboxes, avoiding the need for users to manually check every single related box.
Before you start

Ensure you are using a PDF editor that supports form field properties and custom JavaScript execution, such as Adobe Acrobat Pro. Note down the exact field names of the checkboxes you intend to control.

Solution 1Recommended

Use a Custom JavaScript Action on the Controlling Checkbox

By adding a short JavaScript snippet to the 'Mouse Up' event of the primary checkbox, you can instantly change the state of the related checkboxes.

Interactive PDF forms allow you to attach scripts to form fields. Using the 'Mouse Up' trigger ensures the action runs precisely when the user clicks and releases the checkbox.

1
Open Checkbox Properties

Open your PDF form in edit mode. Right-click the controlling checkbox (the one the user will click) and select 'Properties'.

2
Navigate to the Actions Tab

In the Properties dialog box, click on the 'Actions' tab at the top.

3
Set the Trigger and Action

From the 'Select Trigger' dropdown, choose 'Mouse Up'. From the 'Select Action' dropdown, choose 'Run a JavaScript', then click the 'Add' button.

4
Enter the JavaScript Code

In the JavaScript Editor window, paste the following code: if (event.target.value != "Off") { this.getField("Button1").value = "Yes"; this.getField("Button2").value = "Yes"; } else { this.getField("Button1").value = "Off"; this.getField("Button2").value = "Off"; }

5
Customize Field Names

Replace 'Button1' and 'Button2' with the exact names of your dependent checkboxes, and adjust 'Yes' to match your specific export values. Click 'OK' and close the properties window to test.

Use a Custom JavaScript Action on the Controlling Checkbox
Export Values Matter: Checkboxes use specific 'Export Values' when selected (often 'Yes' by default) and 'Off' when cleared. Ensure the export values in your script exactly match those configured in your checkbox properties.
Efficient PDF Form Management

Create and Manage Interactive PDF Forms in WPS Office

WPS Office provides a powerful, lightweight PDF toolkit that allows you to easily insert, modify, and fill interactive form fields like checkboxes and text fields without hassle.

  1. 1. Open your PDF document: Launch WPS Office and open your existing PDF file.
  2. 2. Access the Form tools: Navigate to the 'Form' tab located in the top ribbon menu.
  3. 3. Insert Checkboxes: Click on 'Check Box' in the toolbar and draw the fields directly onto your document layout.
  4. 4. Adjust Properties: Double-click the inserted checkboxes to easily modify their names, visual appearance, and export values.
Easily add, align, and customize multiple checkboxes in your PDF forms.Fully compatible with Adobe Acrobat PDF form formats and interactive fields.Lightweight and intuitive interface suitable for all experience levels.Comprehensive PDF tools to merge, split, and edit text seamlessly.
microsoft office alternative - wps office

Frequently Asked Questions

How do I find the exact field name of my checkbox?

Right-click the target checkbox, select 'Properties', and look at the 'Name' field under the General tab. This exact spelling, including capitalization, must be used in your JavaScript.

Why isn't my JavaScript executing when I click the checkbox?

Ensure that JavaScript is enabled in your PDF reader's preferences (Edit > Preferences > JavaScript). Also, verify that the script is assigned to the 'Mouse Up' trigger rather than 'Mouse Down' to ensure reliable execution across different PDF viewers.

Can I link multiple checkboxes to behave identically without using JavaScript?

Yes. If you simply want two or more checkboxes to check and uncheck simultaneously without conditional logic, you can give them the exact same 'Name' and 'Export Value' in their Properties menu. They will automatically mirror each other.