Link to home
Start Free TrialLog in
Avatar of cacklebunny
cacklebunny

asked on

Stupid HTML question: possible for user to uncheck radio button?

Chalk this one up as a true brain-fart moment...but as they say in "Dirty Harry," I needs to know.... :)

Is it possible for a user to uncheck a radio button once it's been checked, without using JavaScript?  I could have sworn I was able to do this by using a couple keys on my keyboard, but I'm either remembering incorrectly or can't get the combination of keys/mouseclicks to work.  

I mocked up a page with a couple radio buttons and, sure enough, I can't seem to do it.  I tried the space bar; holding the shift key and then clicking it; hitting the delete key....nothing.  

If this is possible, please share the keyboard combination.  Thanks!
Avatar of knightEknight
knightEknight
Flag of United States of America image

perhaps by resetting the form ... or by reloading the page.

Add a reset button to the form:

<INPUT type="reset" name="btnReset" value="Reset" />
ASKER CERTIFIED SOLUTION
Avatar of M256
M256
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cacklebunny
cacklebunny

ASKER

M256:  No security concerns, this is just simple curiosity.   I seem to have recalled there was a way for the end-user to do it if they knew the right combination of keystrokes/mouseclicks.  I thought it was the spacebar but all that does is toggle the radio button from one choice to the other.  

I know the "reset" button will do it provided the designer actually places a reset button in the form.  I also know you can do it with JavaScript --but again, only if the designer provides this. For the sake of argument, assume that the form has neither a reset button nor a link that causes a JavaScript function to fire.

Thanks.
I cannot say absolutely, but I don't think it is possible with Internet Explorer.

Maybe a non-standard browser?

I found several places where people were trying to deselect radio buttons, but they were using JavaScript.
Example:
http://www-10.lotus.com/ldd/46dom.nsf/0/4c663084da65131685256d630072af1f?OpenDocument

Matthew
Here's a bookmarklet that will do it regardless of whether the designer provides a reset button:

javascript:for(i=0;i<document.forms.length;i++){document.forms[i].reset()}

{Slam}
M256:  

Are you saying IE is a standard browser? ;)

I think you're right in that it must be impossible without a reset button or JavaScript.  So unless someone posts otherwise soon, I'll be passing out the points to you.... "not possible" appears to be the right answer.

As far as other browsers, I've tried to uncheck it using Mozilla and also Netscape 7 and no luck.