I have a select multiple (combobox) in a form and I need to select, using javascript, more than one item in this select. How can I do this?
How can I select multiple itens in select (combobox) using javascript?
Collapse
X
-
If it is a select multiple it should be a listbox and not a combobox.Originally posted by vehuelI have a select multiple (combobox) in a form and I need to select, using javascript, more than one item in this select. How can I do this?
use
i is the index in the list you want to select (0 based)Code:form.select.options[i].selected = true;
Comment