'Un-select' a radiobutton?

14

3

I have always wondered if there is any way or trick to un-select a radio button once you have selected one.

I'm asking this as a generic question, not regarding a specific program. it could be a desktop program or a webpage.

Once you click on a radio button it seems like there is no way to unselect it, so if you wanted to leave the field blank, you can't once you have already made a selection. It kind of 'forces' you to select something.

UPDATE: Im sorry, I was referring to radio buttons and not checkboxes, I confused the terms.

nmuntz

Posted 2009-08-06T13:33:22.283

Reputation: 721

Question was closed 2012-05-29T05:33:25.877

2Can you give a specific example of where you have seen this behavior? Typically check boxes allow you to both check and uncheck the box. – heavyd – 2009-08-06T13:36:24.433

2I think you're talking about radio buttons? – fretje – 2009-08-06T13:43:59.140

@fretje: yes, im sorry. i was referring to radio buttons – nmuntz – 2009-08-06T13:58:43.493

3radiobuttons can't be de-selected "by design" – fretje – 2009-08-06T14:11:19.990

3If you've ever encountered an old car radio, the preset buttons were physical objects that you had to push in. Pushing in one popped out the other. It was nigh-impossible to "unselect" one without pushing in another. I'm sure that's where the name "radio buttons" comes from. – ale – 2009-08-06T16:38:59.937

@Al Everett; +1 but I remember the 'press-to-at-a-time' trick which released all the buttons... at least on my old radios. – beggs – 2009-08-27T09:47:55.337

@Al Everett, on my radio, I can press any button halfway to release all buttons. Still have one at home. – puri – 2009-09-03T12:59:06.590

Answers

31

You're thinking of radio buttons:

a group of round checkboxes where only one can be selected at a time

…and any interface that leaves you wanting to uncheck a group of radio buttons is Doing it Wrong™. Radio buttons should (best) start out with a default option checked, not accept input if the user doesn't make a choice, or (worst) provide a button to uncheck everything.

If complaining to the software/website designer isn't an option, here's a bookmarklet which unchecks every radio button on a page:

javascript:(function(){var%20inputs%20=%20document.getElementsByTagName(%27input%27);for(var%20i%20=%20inputs.length-1;i>=0;i--){if(inputs[i].getAttribute(%27type%27)===%27radio%27)inputs[i].checked=false}})()

...and here's a version that works in the console:

(function(){var inputs = document.getElementsByTagName('input');for(var i = inputs.length-1;i>=0;i--){if(inputs[i].getAttribute('type')==='radio')inputs[i].checked=false}})()

If you're dealing with desktop software, the only option is usually to exit out of the problematic screen and go back in.

s4y

Posted 2009-08-06T13:33:22.283

Reputation: 3 469

I stumble upon this every now and again with online surveys that are badly designed. I couldn't run this script as it said "Unexpected token %" when running it in Chrome's console. What I did instead was use Chrome's ability to edit html: Press F12. Press the little magnifying glass on the far left, select the radiobutton (it should be an li element), then right click the surrounding ul element and select Edit as HTML. Copy one of the other radio buttons (li elements) and insert it beside the others. Select it on the page, and then edit the ul again to remove the radio button. – Aske B. – 2014-05-19T09:05:27.167

1@AskeB. I just added a version that works in the console! – s4y – 2014-05-19T20:44:48.007

7

Add a radio button called None

svandragt

Posted 2009-08-06T13:33:22.283

Reputation: 2 933

1+1 That's what I would do... Radio buttons can't be de-selected "by design"! – fretje – 2009-08-06T14:10:48.837

3

That is generally a problem with Radio Buttons, the circular type of selection widgets that allow for only one of a group to be selected. Checkboxes are designed to have them either checked or unchecked. I doubt that checkboxes in general don't allow deselection. It might be good to give examples of your issue.

Note that if you have a problem 'unselecting' the last selected item in a set, it is always good to attempt clicking on your selection while pressing CTRL at the same time.

akf

Posted 2009-08-06T13:33:22.283

Reputation: 3 781

2It's not really a problem, they're supposed to require a selection. They aren't supposed to be used when "no answer" is valid. – Greg D – 2009-08-06T14:12:53.170

I was using 'generally a problem with' to as a rhetorical device to point out that the OP was probably referring to radio buttons, not checkboxes. I didn't mean to imply that it actually was a problem. – akf – 2009-08-06T14:57:38.977

1+1 for the CTRL solution, which is often not known – Gnoupi – 2009-08-06T15:05:03.220

0

Edit:

If it's a radio button you could use this Javascript sample or perhaps do something with AutoHotKey to make your own shortcut for it:

<script language="JavaScript">
<!--
function unCheckRadio(oRadio) {
      var or = document.getElementsByName(oRadio);
      for (var i = 0; i < or.length; i++) {
         or[i].checked = false;
     }
}
//-->
</script>

Not really relevant anymore, though still useful:

I have written a couple of posts on the topic keyboard Shortcuts for different application and How to improve efficiency and experience by learning to use keyboard shortcuts. But whenever I login to any account, I use the tab button to move across field box to enter the userid and password and I use the mouse to select or deselect ‘Keep me signed in’ check box.

alt text

Only today I realized that I am not aware what's the keyboard shortcut to select or deselect the check box. Did a bit of Googling and found out that Space bar is used for check box. You may come across check box in various places like ‘Remember Me’ or ‘I accept the policy’ and in all those places do remember to use the space bar to select or deselect a check box.

Ivo Flipse

Posted 2009-08-06T13:33:22.283

Reputation: 24 054

Note Firefox Keyboard guide mentions that a radio button doesn't have a toggle (on/off) option – Ivo Flipse – 2009-08-06T13:58:30.827

Well this isn't really useful anymore after he edited his question – Ivo Flipse – 2009-08-06T14:11:58.787

0

Are you sure you're not referring to a radio button? You can usually uncheck a checkbox. If you are referring to a radio button, the closest thing I can think of is using the dev toolbar plugin for Firefox's to clear radio buttons.
Menu > Forms > Clear Radio buttons

jon_brockman

Posted 2009-08-06T13:33:22.283

Reputation:

yes, im sorry, i was referring to radio buttons. – nmuntz – 2009-08-06T13:58:09.190