Hi,
I created a multiple select box wich i would like to have one variable with all the results selected on the multiple select box such as variable_name = "result1|result2|result3"
This is what i have so far:
oSelect = document.getElementById ('s1');
var iNumSelected = 0;
for (var iCount=0; oSelect.options[iCount]; iCount++) {
if (oSelect.options[iCount].selected == true) {
iNumSelected ++;
alert(oSelect[iCount].value); // this part alerts all the result within the loop
}
}
Now what i exactly need is to have a variable called "test" outside of the loop wich i have all the selected results separated with an "|", so that when i do alert(test) displays all results as a one result.
Hope someone can help
Thanks