I need to add an handle to any circumstance where a form validation fails.
I've read this, that explains that I have to add a handler as follows:
$('form').bind('invalid-form.validate', function () {
console.log('form is invalid!');
});
But this event only fires when I try to submit the form.
I need to handle an event that's fired ANY time the form is post-validated (i.e. element loses focus etc.).
What I'm trying to achieve is, I have a large form (~50 fields), and it's splitted in Bootstrap tabs.
I want, that when there is any new validation failure or success, set or clear an error class in the tab title of the tab that contains the invalid/valid elements. P.S. my question is not on how to set those classes in the tabs. I only want to know what event(s) to handle in order to be notified upon each validation state change in the entire form.