Click to See Complete Forum and Search --> : selection size in multiple dropdowns


nikhilpen
08-27-2004, 09:27 AM
Hello all,

I am looking for a way to get the total number of selections made in a multiple selectable dropdown.
document.formName.dropdown.options.length gives the total size,but not the selected size.

Also is there a way to prevent multiple selects?say I want the user to select a maximum of 6 values.
Thanks in Advance

nikhilpen
08-27-2004, 09:34 AM
var count = 0;
for(i = 0 ; i < document.newAllegation.allegation.options.length ; i++){
if(document.newAllegation.allegation.options[i].selected)
count++;
}
alert(count);

worked.