Validate with 1000hz plugin a select2 with multiselect


#1

Can you tell me how validate a select2 field with multiselect? I need check if use have select one or more items from select2 in alternative the validation must return false.


#2

I’m not sure what you mean by “validate”. Do you mean when the form is submitted?

The easiest way is to call the select2('data') method in your form’s onSubmit handler. It will return an array containing the user’s selection(s). If the user has not made any selections, then the returned array will be empty.