Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2153
  • Last Modified:

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!
0
cacklebunny
Asked:
cacklebunny
1 Solution
 
knightEknightCommented:
perhaps by resetting the form ... or by reloading the page.

Add a reset button to the form:

<INPUT type="reset" name="btnReset" value="Reset" />
0
 
M256Commented:
Once it is checked on the page, it is not supposed to be possible to uncheck it except by checking another in the series.

However, if you are worried about a hacker doing something, it is possible.  Anybody can copy the html page to their computer, unselect the default (if you have one), change the action page of the form to your remote page, and submit it.

Matthew
0
 
cacklebunnyAuthor Commented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
M256Commented:
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
0
 
superslamwichCommented:
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}
0
 
cacklebunnyAuthor Commented:
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now