Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using radio buttons...should ID and NAME values be the same?

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
i have a quiz with 20 questions. each question has between 2 and 5 possible answers, with a radio button for each answer.

i have set up a question to demonostrate how each radio button goes:

Code:
do you like hot dogs?
<input type=radio id=question1 name=question1 value=q1yes>
<input type=radio id=question1 name=question1 value=q1no>
<input type=radio id=question1 name=question1 value=q1maybe>

the question comes up when i validate the html. it says that the ID 'question1' already has been assigned.

is it okay if i leave the id's the same?

- g
 
No, Id's have to be unique, to keep the buttons in the same radio group, give them the same name for each in the group.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top