Once a radio button is selected, how can you unselect it without selecting another radio button (no radio buttons should be selected)?
Printable View
Once a radio button is selected, how can you unselect it without selecting another radio button (no radio buttons should be selected)?
Code:<html>
<head>
<title>Test</title>
<script>
function unselect(){
f.sex[0].checked = false
f.sex[1].checked = false}
</script>
</head>
<body>
<form name="f">
Male<INPUT TYPE="radio" NAME="sex">
Female<INPUT TYPE="radio" NAME="sex">
<Input type="Button" value="Unselect" onclick="unselect()">
</form>
</body>
</html>
I do not want to use a button to clear the contents though. I want to click the radio button a second time to unselect it.
HOw could that be possible...
It will trigger the unselect function on clicking the radio..so no one can in effect actually use the radio button...even for the first time.
I have found a way to do this, but I will have to post back later, as it is time to get out of the office....