Page 1 of 1

Setting a limit for <select mutiple>

Posted: Tue Feb 01, 2005 1:40 pm
by kendall
Hello,

Can you use javascript to define the max number of options to select from a menu/list that allows for multiple select options?

e.g

lets say that i have 20 options for a select list i want to only select five

Kendall

Posted: Tue Feb 01, 2005 4:31 pm
by patrikG
you could use the onSelect-event to call a function which checks the total number of items selected. If too many, have JS de-select the one with the focus.