tags:

views:

63

answers:

1

I have a form which has several tags.

is this possible:

   <select name="select1" id="select1">
       <option id="1990" value="1990">1990</option>
       <option id="1991" value="1991">1991</option>
   </select>

   <select name="select2" id="select2">
       <option id="1990" value="1990">1990</option>
       <option id="1991" value="1991">1991</option>
   </select>

The ID are the same...

Thanks

+6  A: 

No id can be assigned only once since it is an identity for just a single element. You need to use class instead but i wonder why you need to assign same ids? If you assign same ids to more than one element, and use javascript, etc to manipulate it, then only last element with same id will be taken care of ignoring all previous elements....

For more information, please see:

ID vs CLASS

Sarfraz
To add to this: keep the ids on the select elements, remove from option elements, retreive option elements through select elements.
Anonymous
@Anonymous: that is rightly said. thanks for adding that :)
Sarfraz