I know its been some time since this suggestion was made but I would like to chime in and say that I agree with the OP in that it would be very convenient to have this callback fire after the errors are shown.
In my situation there are some more complex formatting issues I would like to do when a form is invalid but it depends on the fields having their error class applied.
- invalidHandler: function(form, validator) {
- var errors = validator.numberOfInvalids();
- if (errors) {
- validator.showErrors();
- // Do any work after errors are shown here.
- }
- },
I, like the OP, had to call showErrors myself in the invalidHandler. One thing to note for anyone in the future if you do this is that the form argument for invalidHandler doesn't include the error classes that are added from validator.showErrors(). So if you want to find all of the elements with '.error' then you need to make sure to go directly to the form again using jquery.
Hope this helps anyone down the road.