OK this got me a significant performance bump and works in IE (there is like
5800 options in this multi select, don't ask me why): Seems caching the
elements themselves instead of the element values did the trick.
var csubs = null;
$('select[name="Subdivision"]').change(function(){
var tsubs = $(this).val();
if(tsubs.length > 10){
alert('Cannot select more than 10');
$(this).find('option:selected').attr('selected',false);
csubs.attr('selected',true);
} else {
csubs = $(this).find('option:selected');
}
});
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]