Go Back   Ultimate Web Site Drop Down Menu Forum > Web Development > CSS and HTML
Register FAQ Members List Calendar Today's Posts

Reply
Thread Tools Display Modes
Unread 02-27-2008, 02:47 PM
ISMAILC ISMAILC is offline
Member
Join Date: Dec 2007
Posts: 45
  #1  
Question Unselecting one Radio button

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
Reply With Quote
Unread 02-28-2008, 01:16 PM
vinyl-junkie vinyl-junkie is offline
Moderator
Join Date: Aug 2007
Posts: 114
  #2  
Default

Here's a javascript example that I found:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<title&gtDeselect A Radio Button</title> 
<script language="JavaScript" type="text/JavaScript">
<!--
function uncheckRadio() {
 var choice = document.form1.RadioGroup1;
 for (i = 0; i < choice.length; i++) {
  if ( choice[i].checked = true ) 
   choice[i].checked = false; 
 }
}
//-->
</script>
</head>

<body>
<form name="form1" method="post" action="">
      <p>
        <label>
        <input type="radio" name="RadioGroup1
" value="1" ondblclick="uncheckRadio();">
    Apple</label>
        <br>
        <label>
        <input type="radio" name="RadioGroup1" 
value="2" ondblclick="uncheckRadio();">
    Orange</label>
        <br>
        <label>
        <input type="radio" name="RadioGroup1" 
value="3" ondblclick="uncheckRadio();">
    Grape</label>
        </p>
    </form>
</body>
</html>
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!

Last edited by vinyl-junkie : 02-28-2008 at 01:21 PM.
Reply With Quote
Unread 02-28-2008, 01:22 PM
ISMAILC ISMAILC is offline
Member
Join Date: Dec 2007
Posts: 45
  #3  
Default Great!!! Thank You VERY MUCH

Great!

I am going to add it to my xslt file & start checking it.

Thank You.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:39 AM.


Powered by vBulletin® Version 3.0.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.