Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unselecting radio button value

    How can I clear a radio entry if someone decides they dont want to choose either one? So if they enter a "Yes" for membership entry and then decide they dont want to enter anything in this entry then the radio button wont let them unselect the entry, it only allows them to select a "No" entry or what they have already selected "Yes" entry. Is there anyway to unselect a radio entry for a field so no selections are entered after a user has already selected one entry?? I only can have two entries as seen below so please advise.


    Code:
    Yes<input type="radio" name="membership" value="Yes"><br>
    No<input type="radio" name="membership" value="No">

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    Kansas, USA
    Posts
    477
    Thanks
    0
    Thanked 51 Times in 50 Posts
    A third radio button, but you'll have to make sure the descriptive text is very clear what the third option does. (Which is to select an empty value for the field.)
    Code:
    <label>Yes<input type="radio" name="membership" value="Yes"></label>
    <label>No<input type="radio" name="membership" value="No"></label>
    <label>N/A<input type="radio" name="membership" value=""></label>

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ondblclick="this.checked=0?1:0"

  • #4
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    <input type="reset">
    Or, if "no" and no selection means the same thing, just use one checkbox for "yes".


  •  

    Posting Permissions

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