How to Synchronize Two Checkbox Groups by Widget Index in Acrobat PDF
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.

- 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.
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.
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.
Open your PDF document in Acrobat, go to the Tools menu, and select Prepare Form to enter editing mode.
Right-click the first checkbox group (the source group) and select Properties from the context menu.
Navigate to the Actions tab, select 'Mouse Up' as the trigger, choose 'Run a JavaScript' from the Select Action dropdown, and click Add.
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.
Click OK to close the editor, exit Prepare Form mode, and click the checkboxes to verify that the second group updates automatically.
Synchronize Checkboxes Without JavaScript Using Identical Field Names
Use this alternative if you simply want two checkboxes to always mirror each other without relying on widget index scripts.
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. Open PDF Editor: Launch WPS Office and open your PDF document using the WPS PDF tool.
- 2. Access Form Tools: Navigate to the Form tab on the top ribbon to access interactive form controls.
- 3. Add Checkboxes: Click the Check Box tool and place the widgets directly onto your document where needed.
- 4. Adjust Properties: Double-click the added checkbox to modify its export values, appearance, and synchronization settings.

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.




