I want to loop through an options array of a multiple select list and identify each selected item. All the examples I can find seem to deal with only reading the first selected item. A simple loop example would be appreciated.
Reading multiple selected items
Collapse
X
-
Tags: None
-
Well I figured it out
Code:var cNewVal = "" for(i=0;i<document.getElementById("rDEPT").options.length;i++) { if (document.getElementById("rDEPT").options[i].selected ) { cNewVal += document.getElementById("rDEPT").options[i].value+"~" } } document.getElementById("REVIEWDEPT").value = cNewVal
Comment