Add support for unobtrusive jQuery validation
When activating jQuery validation (bassistance) on a form it usually validates every field as soon as it is left or changed, by hooking in the blur() and change() events.
Microsoft's unobtrusive enhancement makes it possible to define all validation rules as data-val-* attributes on the HTML elements. They are parsed in one go, and the jQuery validation is activated on the form.
When using data-val-* on a
One solution to this could be that on blur() of the multiselect widget, blur() is triggered the underlying
@mlh758 Based on the above description, I have reviewed the current multiselect code and I have determined that the change() event is triggered on the underlying select element for the case of a single checkbox being checked, as well as in the _toggleChecked() function (checkAll, uncheckAll, etc.).
However, the blur() event for the underlying select is not triggered when a blur occurs for the button or the menu. A focus() event is also not triggered.
The question is whether there is value in triggering these for the underlying select. There are already event handlers for the button for these events, so those could be leveraged. However, there are no such event handlers for the menu.
It does appear that the jQuery validate plug-in does still use the blur event: https://jqueryvalidation.org/validate/
It's probably good to trigger the blur if validate is looking for it. However, I think it might not be good to trigger the select blur from the button blur since that might get triggered just by opening the menu as focus shifts from the button to the first option.
Triggering the select's blur on menu close would probably be the most accurate thing from a user perspective but we would also need to account for the ability to modify a single select's value just by using the up/down keys on the button with the menu closed.