Results 1 to 5 of 5

Thread: Unselect Radio Button

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249

    Unselect Radio Button

    Once a radio button is selected, how can you unselect it without selecting another radio button (no radio buttons should be selected)?
    Normal is boring...

    smh

  2. #2
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272
    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">&nbsp;
      Female<INPUT TYPE="radio" NAME="sex">
      <Input type="Button" value="Unselect" onclick="unselect()">
     </form>
    </body>
    </html>

  3. #3

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    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.
    Normal is boring...

    smh

  4. #4
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272
    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.

  5. #5

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    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....
    Normal is boring...

    smh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width