PDF Editing Issues

How to Synchronize Two Checkbox Groups by Widget Index in Acrobat PDF

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 869 views

Question details

The user needs to identify the selected checkbox in one group and mirror that selection in a second checkbox group within an Acrobat PDF using JavaScript.

How to Synchronize Two Checkbox Groups by Widget Index in Acrobat PDF
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating interactive PDF forms where checking an option in one area automatically checks the corresponding indexed option in another area.
Observed behavior
The user wants to programmatically link two separate checkbox groups so they remain synchronized based on their widget index when a user interacts with them.
Before you start

Ensure that both checkbox groups in your PDF form are fully created and have an identical number of widgets with properly matching export values before applying the JavaScript.

Solution 1Recommended

Use Acrobat JavaScript to Sync Checkboxes via checkThisBox()

Apply a custom JavaScript script to the checkbox field to detect the selected index and apply it to the target group.

To synchronize two checkbox groups, you need to read the export value of the triggered checkbox, find its corresponding index in the widget array, and update the second checkbox group using the checkThisBox() method.

This approach requires that both groups are structured identically in the form hierarchy so that the widget indexes accurately map to one another.

1
Open Prepare Form Mode

Open your PDF document in Acrobat, go to the Tools menu, and select Prepare Form to enter editing mode.

2
Access Source Checkbox Properties

Right-click the first checkbox group (the source group) and select Properties from the context menu.

3
Add a JavaScript Action

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

4
Enter the Synchronization Code

In the JavaScript Editor, write a script that identifies the selected export value, loops through the widgets to find its index, and calls the checkThisBox() function on the target field group using that same index.

5
Save and Test

Click OK to close the editor, exit Prepare Form mode, and click the checkboxes to verify that the second group updates automatically.

Widget Order Requirement: Both checkbox groups must have the same number of widgets added in the exact same sequence for the index synchronization to work correctly.
Advanced PDF Form Editing

Easily Create and Edit Interactive PDF Forms with WPS Office

WPS Office provides a comprehensive PDF Editor that allows you to easily insert checkboxes, text fields, and manage form properties without complex coding, making interactive document creation seamless.

  1. 1. Open PDF Editor: Launch WPS Office and open your PDF document using the WPS PDF tool.
  2. 2. Access Form Tools: Navigate to the Form tab on the top ribbon to access interactive form controls.
  3. 3. Add Checkboxes: Click the Check Box tool and place the widgets directly onto your document where needed.
  4. 4. Adjust Properties: Double-click the added checkbox to modify its export values, appearance, and synchronization settings.
Create interactive forms with checkboxes, text fields, and dropdowns seamlessly.Highly compatible with standard PDF formats and Adobe Acrobat form fields.Lightweight, fast, and features an intuitive user-friendly interface.Includes advanced tools to sign, merge, and secure your PDF documents easily.
microsoft office alternative - wps office

Frequently Asked Questions

Why are my PDF checkboxes selecting together automatically?

If multiple checkboxes share the exact same field name and export value in your PDF form, they will act as synchronized clones. To keep their selections independent, ensure each group or individual checkbox has a unique name.

What is the widget index in a PDF form?

The widget index is the sequential numerical position of an individual control (like a checkbox) within a single form field group that contains multiple items. It is zero-based, meaning the first widget is index 0.

Can I synchronize PDF checkboxes without writing JavaScript?

Yes. If your goal is simply to have two checkboxes behave identically (both checked or both unchecked at the same time), you can assign both checkboxes the exact same field name and the same export value. Acrobat will automatically sync them.