When using forms, the name attribute is used to pass the data, as SJH has said. The id attribute is for presentation (using CSS) or client-side scripting (using javascript and DOM).
Edit:
You can use the name attribute with javascript, as well, but it’s usually more efficient to use the id.
Sorry… It seems like my problem is completely different!!! I have a script in which I choose members from 1 selectbox to another… When I pass the users to the second selectbox thay are no chosen/marked and when I then submits the form… ofcourse there is no records… Is there a way that I can make every record in a select box count even though they are not marked!!!
Ok. So I’m suggesting that when you add an option to the select element, you also create a hidden input element which matches the value you just added.
You could also just loop through all the options and set the selected attribute to true using an event handler for the forms submit event.
You don’t. You create multiple hidden input elements. see createElement() to make an input element, and appendChild() to append it to the form element.