// initialize MultiSelect component
var listObj = new ej.dropdowns.MultiSelect({
// set the placeholder to MultiSelect input element
placeholder: 'Favorite Sports',
// set the type of mode for how to visualized the selected items in input element.
mode: 'CheckBox',
change: onChange
});
listObj.appendTo('#default');
var options = {
rules: {
default: { required: true }
}
};
// Initialize the FormValidator.
var formObj = new ej.inputs.FormValidator('#formId', options);
function onChange(args) {
formObj.validate("default"); // To validate the Multiselect component
} |