vicb/bsmSelect

How to allow up to 3 selections ?

margsot opened this issue · 1 comments

Hi is there any way to allow users to select up to 3 options and when someone try to select the 4th option to display a js alert message "You can only select up to 3 items" ?

That would be perfect for me.

Best Regards

vicb commented

You should be able to achieve this by listening at the change event (type "add"). Call event.preventDefault() to prevent the item from being added.

An other option is to write a simple plugin that would disable the select when the number of selected element is 3.