Skip to main content
Jan 5, 2017 4:34 PM UTC
Answered

How do I clear a radio button?

Is it possible to deselect a choice in a radio button group on a fillable PDF? There are times a radio button choice may be selected accidentally. When this happens, the only choice one may have is to abandon the form they have been completing, and start from scratch in hopes the mistake is not made again. Our forms are very detailed and with multiple pages and combinations of drop downs, check boxes, radio buttons, text boxes, etc... with questions totaling well over 100.  You can imagine someone's frustration if they've completed over 100 questions and near the end of the form there's a radio button question they did not mean to answer... The radio buttons are used exclusively for one choice selections only, otherwise check boxes are used. I'm interested in any simple solutions. Maybe Adobe can come up with a solution. I don't understand why radio buttons don't function the same way as check boxes. If you click once, it's marked; if you click again, it clear. Any help is greatly appreciated. Detailed steps for the fix are also appreciated. Thanks!

try67
try67Correct answer
Community Expert
Jan 5, 2017 4:58 PM UTC

This is the functional definition of radio-buttons. Once a selection is made, you can only switch from one button to another, not de-select them entirely (unless you reset the form).

If you want to be able to de-select the buttons then you should use check-boxes. Give them the same name but different export values and they'll function just like radio-buttons (ie, when you click on button in a group the selected one becomes un-selected), with the additional feature that you could de-select a button but clicking it.

99 replies

Participant
Sep 5, 2023 12:53 AM UTC

If you want to modify the behavior of the radio button group such that the selected radio button can be unselected by clicking on it then here is one way to do it. For this example consider three radio buttons in the group and the radio button group's name is "RadioButton1". The following code should be added as a document-level script:

var rb = getField("RadioButton1");
rb.exportValues = [ "First", "Second", "Third" ];
var cval = "";

The following code should be added to every radio button that should be unselected:

if (cval==rb.value) {
  rb.value = "";
  cval = "";
} else {
  cval = rb.value;
}

I have included an example PDF document with radio buttons that behave as you required.

Translate
try67
Community Expert
Community Expert
Sep 5, 2023 9:19 AM UTC

Use check-boxes instead of radio-buttons.

Translate
Participant
Mar 23, 2022 8:21 PM UTC

One way to do this is to toggle the option "button is checked by default" on/off.

Translate
Participant
Feb 4, 2022 5:44 PM UTC

If you, as the form creator/owner, want to reset the form, you can just do it the way it's mentioned below (Tools - Forms - Preapare Form - More Options - Clear Form). BUT, if you want the end user to be able to deselect radio buttons or you just want a quick way to clear the form (or just specific fields) it is possible to add a button to your PDF to do just that.  

 

Here's how to create & label the button:

Place the button form field on your form where you want it, give it a name and click the All Properties link. This opens the Button Properties dialog box. Click the Actions tab, then choose Reset a form in the Select Action from the drop down list. Next, click Add..., and select the fields you want to reset in the Reset a Form dialog box. Click OK. On the Options tab you can give the button a label. If you don't, the button will be blank and the end user won't know what it's for. 

Translate
Known Participant
Nov 1, 2024 10:51 PM UTC

In Acrobat 2024, if you are the author creating the form and need to reset it after testing, go to All Tools > Prepare a Form. Then in the Fields panel on the right side there is an Options menu (three dots) which has Clear Form. 

Translate
Participant
Dec 31, 2021 5:25 AM UTC

An alternative to clearing the form is to combine the target group with another group, then split them apart.  

 

Create a new radio group, change the name of the target group to the same name as the new group (the new group will now have 4 buttons). Then change the name of the target group back to the desired name. The radio buttons will be unchecked.

Translate
try67
Community Expert
Community Expert
Dec 31, 2021 10:14 AM UTC

That is an incredibly convoluted solution to a problem that can be easily solved with a single line of code.

Translate
Participant
Mar 23, 2021 10:03 PM UTC

Edit->Clear Form.

Translate
Participant
Dec 7, 2020 7:10 PM UTC

So you accidentally clicked a button and saved your complete form.  We found a work-around to deal with this. Basically what you do is add a button to the form under the same group-> go to the preview -> Select the new button -> Sacrifice that button with the selection in it by deleting it.

Translate
try67
Community Expert
Community Expert
Dec 7, 2020 7:18 PM UTC

That's a very cumbersome way of solving this issue. You can just clear the form, or run this JavaScript code to clear this one field:

this.resetForm(["Radio1"]);

(replace "Radio1" with the actual field name, of course)

Translate
Participant
Nov 16, 2020 8:25 PM UTC

In the case of ...

"There are times a radio button choice may be selected accidentally. When this happens, the only choice one may have is to abandon the form they have been completing...."

... then,  the  Edit / Undo action worked for me,

near the end of a long form, which I was about to abandon, after I searched for help, to no avail, and just before I clicked on "NO, do not save changes before closing "  ...

Translate
LarsenLP
Participant
Jul 12, 2021 7:46 AM UTC

This is actually a brilliant advice. Nice workaround!

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jan 5, 2017 4:58 PM UTC

This is the functional definition of radio-buttons. Once a selection is made, you can only switch from one button to another, not de-select them entirely (unless you reset the form).

If you want to be able to de-select the buttons then you should use check-boxes. Give them the same name but different export values and they'll function just like radio-buttons (ie, when you click on button in a group the selected one becomes un-selected), with the additional feature that you could de-select a button but clicking it.

Translate
Jan 5, 2017 5:13 PM UTC

Thanks TRY67...my reply crossed yours. Good to know I can use check boxes. I'll play with that.

Translate
Ned Murphy
Legend
Jan 5, 2017 4:50 PM UTC

One option is to always include an extra "N/A" option that is preselected.  That way if someone did not intend to answer they can recheck.

As far as Adobe changing the way radio buttons work goes, don't count on it.  I believe it is an industry standard for radio buttons - I do understand the frustration you describe when you cannot deselect.

Translate
Jan 5, 2017 5:00 PM UTC

Thanks for the very prompt response! Yes, I was hoping to avoid any additional selections on the forms. They are quite dense and use a size 9 font. You can imagine, I'm sure, there is very limited space. If we used a standard size 12 font, many of our forms would be over 4 pages... I understand what you mean by industry standard. Is there a way to set a check box to a select one only? Thanks again.

Translate