SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to clear a radio button?

    how can i clear a radio button? i tried wrting a script but it doesn't work...can anyone help me??

    Code:
    <input type="radio" name="button1" id="button1" value="Value1">1
    <input type="radio" name="button1" id="button2" value="Value2">2
    <input type="radio" name="button1" id="button3" value="Value3">3
    
    <input type="button" Onclick="
    document.getElementById('button1').value=' '; 
    document.getElementById('button2').value=' ';
    document.getElementById('button3').value=' ';
    " value="Clear"

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2005
    Location
    Michigan, USA
    Posts
    434
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    To "uncheck" a radio button, I believe you do something like this:
    Code:
    document.getElementById('button1').checked=false;
    - Robert


Bookmarks

Posting Permissions

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