I have a select box which has more than 200 items.
Below the select box is the submit button which submits the form using javascript.
I want to restrict the user to only select 100 items from the select box. If they select box and try to submit the form then it will say Select 100 Only
How can I do this in Javascript?
You can either:
Loop through all of the options elements and check the selected attribute:
Or you can get the
valueof the select element and split the value by comma and base it on the number of items in the array.