Multiple Item Select

wxdqz

New Member
I have a listbox that has the multiple property enabled. I want to be able to pass all of the information from this listbox using the form post method. The only way I know to do this is to select all of the options in the list box on form submittal. The only problem is the code that I am using, is not working for me. Here is what I have:


function frmUserGroup_onsubmit() {
if(document.frmUserGroup.sltMembers.options.length < 1) {
if(confirm("There are no members selected, are you sure you wish to continue?")) {
return true;
} else {
return false;
}
} else {
members = document.frmUserGroup.sltMembers
members.multiple = true;
for(i = 0; i < members.options.length; i++) {
members.options(i).selected = true;
}
}
}


This code will leave only the last line selected. I need to make sure that all items are selected before the form is submitted. Any help would be greatly appreciated.
 
Top