How to Set a Second PDF Checkbox Group from Another Group's Value
Question details
The user needs to automatically copy the selected export value from one PDF checkbox group to a second checkbox group using a calculation script.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating interactive PDF forms and automating data entry by linking the selections of two different checkbox groups.
- Observed behavior
- Looking for a working JavaScript method to transfer a selected checkbox value to another calculated field or checkbox group.
Ensure you have access to a PDF editor with form editing capabilities and verify that the export values in both of your checkbox groups match exactly before applying the script.
Use a Calculation Script with a Hidden Text Field
Implement a JavaScript calculation to automatically transfer the value from the source checkbox group to the destination checkbox group.
By using a hidden text field or a calculated field, you can pull the export value from the primary checkbox group and assign it to the secondary group. It is crucial that both groups share the exact same export values for the sync to function correctly.
Open your PDF document in your PDF editor and enter the form editing or prepare form mode.
Insert a new text field into your document. Set its properties to 'Hidden' so it does not display on the final form.
Right-click the hidden text field, select 'Properties', and navigate to the 'Calculate' tab.
Select 'Custom calculation script' and enter the following code: this.getField("Joint1Type").value = this.getField("AccountOwnershipType").value; (Replace 'Joint1Type' with your destination field and 'AccountOwnershipType' with your source field).
Exit form editing mode, save your document, and test the primary checkbox group to ensure the secondary group updates accordingly.

Automate PDF Forms Effortlessly with WPS Office
WPS Office provides robust PDF editing capabilities, allowing you to create, modify, and manage interactive PDF forms effortlessly. Easily add checkboxes, text fields, and configure form properties for automated workflows.
- 1. Open your PDF: Launch WPS Office and open the PDF document you wish to turn into an interactive form.
- 2. Navigate to the Form tab: Click on the 'Form' tab on the top ribbon to reveal the interactive form editing tools.
- 3. Insert form fields: Select 'Check Box' or 'Text Field' from the menu and click on the page to place your form elements.
- 4. Configure properties: Double-click or right-click the inserted field to modify its properties, set export values, and customize formatting.

Frequently Asked Questions
Why is my second checkbox group not updating after adding the script?
Ensure that the export values in both checkbox groups match exactly. If the destination group does not have a matching export value assigned to one of its checkboxes, the script will not be able to apply the selection.
Can I use this script for radio buttons instead of checkboxes?
Yes, the exact same logic applies to radio button groups. You can transfer the selection by matching the export values of the radio buttons and using the same this.getField script.
Where exactly do I paste the custom calculation script?
In form editing mode, right-click the field you are using as the trigger (often a hidden text field), select 'Properties', go to the 'Calculate' tab, choose 'Custom calculation script', and paste your JavaScript code there.




