tarrike
asked on
Select... tag
I have a select tag with more than 200 options. I allow the user to select multiple options, but I want to limit them to 8. Is there any code samples to do this?
Add a onchange function to the select. This function should count the number of options that are selected, and alert the user if they have selected more than the desired number, also unselecting the last item selected.
Of course you'll need to store the indexes of the last set of selected items so that you can revert back to this if they select more than the max.
-Mike
Of course you'll need to store the indexes of the last set of selected items so that you can revert back to this if they select more than the max.
-Mike
Or perhaps return false if the select more than the max?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! That worked perfectly
Cd&