Fix Overwritten Radio-Button Choices in Acrobat JavaScript
Question details
Manage multiple text fields and radio-button choices without overwriting earlier selections or causing invalid-value errors.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form uses JavaScript to associate text-field values with radio-button choices.
- Observed behavior
- Later fields overwrite earlier values, and the form reports an invalid-value error.
Open the PDF in desktop Acrobat and choose Prepare a form. Identify the text fields, radio-button group names, and export values you want the script to connect.
Check Radio-Button Group Names and Export Values
Use this check to find naming conflicts or values that do not match the available radio-button choices.
In Acrobat, open Prepare a form and double-click each radio button to open its properties. Buttons in one group share a field name; use a different group name for each independent set of choices.
In each radio button's Properties dialog, open the Options tab and record its export value. Confirm that the script assigns a value that exactly matches one of the choices in that group.
Double-click each text field in Prepare a form and check its name in Properties. Update any script references so each text field points to its intended radio-button group.
Save the form and test it in desktop Acrobat rather than a browser. If an error appears, open the JavaScript console and review the complete message and the field or script it identifies.
Map Each Text Field to Its Own Radio-Button Group
Use a consistent mapping when several text fields control separate radio-button groups.
Use WPS Office for Everyday PDF and Document Work
WPS Office is a free, lightweight alternative for working with PDFs and Office documents in a familiar interface. Its Microsoft Office format support makes it easy to bring existing files into your workflow, although it does not fix Acrobat-specific JavaScript errors.

Frequently Asked Questions
Why does selecting one radio button clear another selection?
Radio buttons with the same field name belong to one group, so selecting one normally clears the other. In Prepare a form, check each button's Properties and give independent groups different names.
What value should a script assign to a radio-button group?
Assign the exact export value of the desired button. Find it by opening the button's Properties in Prepare a form and selecting the Options tab.
How can I clear a radio-button group with JavaScript?
Assign the group the value 'Off', for example: this.getField('Choice1').value = 'Off'. Replace Choice1 with the exact group name.
Why should I test the form in Acrobat instead of a browser?
Browser PDF viewers may support Acrobat form JavaScript differently or not run it. Open the saved PDF in desktop Acrobat and check the JavaScript console for the complete error message.




