15

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.

BinaryMisfit
  • 20,879
nmuntz
  • 761

5 Answers5

32

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
  • 3,859
7

Add a radio button called None

svandragt
  • 3,353
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
  • 4,021
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.

Gareth
  • 19,080
Ivo Flipse
  • 24,894
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