Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Radio Button – Am I Doing Something Wrong? Help!

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37324
    iamshad
    Member

    Hello Forum,

    So… I’m having a problem with simple radio buttons (no jQuery or Javascript). I was learning on how to create radio buttons for a contact form and I basically followed what I saw. But for some reason, my radio buttons are grouping like they’re check boxes. Is there a reason why this is happening? Is the approach I’m taking at this correct or incorrect?

    I’ve loaded the code here: http://jsfiddle.net/iamshad/Am9Zw/

    Thanks in advance for the help,

    Shad
    (cheers)

    #99887
    Senff
    Participant

    If you mean that selecting one checkbox doesn’t deselect the other, that’s because you gave them all a different name. If you want to “group” them, give them all the same name (and obviously each a different value).

    Additionally, you have everything (inputs and text labels) wrapped within a label; not really sematically correct. I would suggest to go with this structure:














    #99892
    iamshad
    Member

    Hey @seniff I had a feeling I was doing something wrong. But what you explained did fix the problem. I should’ve known this… I’m going to try what you mentioned above for a better semantic approach.

    Thanks for your help!
    Shad

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.