Reset an Acrobat PDF Radio Button Group with JavaScript
Question details
Select the first radio button whenever a checkbox is clicked in a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form has a checkbox and a radio-button group named execution, with radio-button export values of 0 and 1.
- Observed behavior
- The desired result is for the radio button with export value 0 to be selected when the checkbox's Mouse Up action runs.
Open the PDF in Adobe Acrobat and check that the radio-button group is named execution and that the first button's export value is 0. You need access to the checkbox's form field properties to add a JavaScript action.
Set the Radio Group Value in the Checkbox Mouse Up Action
Use the first radio button's export value to select it when the checkbox is clicked.
In Acrobat, open the PDF and choose Prepare a form to access the form fields.
Double-click the checkbox to open its properties, then select the Actions tab.
Set Select Trigger to Mouse Up and Select Action to Run a JavaScript. Click Add and enter: this.getField("execution").value = "0";
Confirm the script, close the properties, and save the PDF. Preview the form and click the checkbox to verify that the radio button with export value 0 is selected.

Work with PDF Documents in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format compatibility makes it easy to move existing files into your workflow. Use Acrobat to configure and test the specific JavaScript form action described above.

Frequently Asked Questions
Why does the script use "0" instead of the first button's position?
Acrobat selects a radio button by the group's export value. Set this.getField("execution").value to "0" because that is the first button's export value in this form.
Where do I add the checkbox JavaScript in Acrobat?
Open Prepare a form, double-click the checkbox, and use the Actions tab. Select Mouse Up as the trigger and Run a JavaScript as the action, then click Add.
What should I check if the radio button is not selected?
In Prepare a form, check the radio group's field name and the first button's export value in its properties. They must match execution and 0 exactly for the example script to work.
Will Mouse Up run when the checkbox changes without a mouse click?
Not necessarily. Mouse Up is a mouse action, so test any keyboard or programmatic changes separately if the form must handle them.




