I'm having trouble trying to do some custom validation using select2 jQuery plugin
I need to get the user to select at least 2 items from the list. The select2 plugin has the maximumSelectionSize property, which allows the user to select up to X elements from the list, but it does not have a "reverse" property. Also the required tag will not work, because I need to select more than one element.
Since I'm working on creating a custom validator with the parsley validation plugin, I will need to know how to get at any moment (usually in the form of submit) the current number (number) of elements selected in the select2 field? Maybe using the val () method?
thanks
source share