Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ID already defined

Options
  • 24-04-2008 7:55pm
    #1
    Users Awaiting Email Confirmation Posts: 92 ✭✭


    Hi Guys,

    im trying to validate a form for xhtml and one of the errors coming up a lot is ID "whatever" already defined. How do i get around this as in the case of radio buttons the id is the same for the yes and no states. I thought the id for them had to be the same for the radio button to work correctly?

    Thanks


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 8,956 Mod ✭✭✭✭mewso


    No it's name that has to match not the id.


  • Closed Accounts Posts: 35 dkell


    The ID attributes need to be unique for each HTML element on a page


  • Users Awaiting Email Confirmation Posts: 92 ✭✭alanjgrace


    Ok guys cheers


  • Registered Users Posts: 467 ✭✭nikimere


    If you using ID to reference multiple elements on a page you will fail XHTML, however you can use "class" instead of "id" and that should work fine.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    nikimere wrote: »
    If you using ID to reference multiple elements on a page you will fail XHTML, however you can use "class" instead of "id" and that should work fine.
    The class is just for the style though.

    The specification should really include a "group" attribute - while "name" is the correct way to group them, I don't think it's all that intuitive in this instance.


  • Advertisement
  • Registered Users Posts: 467 ✭✭nikimere


    Yeh your right, i didnt' read the 1st post properly.... :o
    It was early :p


Advertisement