467,163 Members | 986 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,163 developers. It's quick & easy.

Unselecting one Radio button

100+
Hi, I need help!

I Would like to know of one can unselect a radio button.

i know one can unselect a radio button by selecting another radio button.

but what happens when there is only one, is there a way i can select & unselect the radio button?

Any ideas,

Regards
Feb 27 '08 #1
  • viewed: 5691
Share:
1 Reply
ronverdonk
Expert 4TB
I found this some time ago on the web, and it works.It resets all radio buttons in the named group:[html]<input type="radio" name="dutyid" value="1">One
<input type="radio" name="dutyid" value="2">Two
<input type="radio" name="dutyid" value="3">Three
<input type="button" name="do" value="Deselect" onclick="javascript:unselect()">

<script>
function unselect()
{
var oRadio = document.getElementsByName("dutyid");
for(i=0;i<oRadio.length;i++)
oRadio[i].checked = false;
}
</script>[/html]Ronald
Feb 27 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Digital Puer | last post: by
3 posts views Thread by John Davis | last post: by
8 posts views Thread by David Cameron | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.