The suggestion makes sense, though there are probably also cases where the current order makes more sense, and changing it will cause other issues.
Take a look at this tabs demo for an alternative implementation: http://jquery.bassistance.de/validate/demo/tabs/ Jörn On Fri, Apr 17, 2009 at 12:26 PM, snobo <g...@riga.ahlers.com> wrote: > > Hi Jörn, > > incredibly awesome plugin you've made, thanks a million! Started to > explore and using it, and stumbled onto situation. > > In my invalidHandler, I'm trying to access the first input which is > marked as invalid (in order to ensure that it is visible - my form is > split on tabs, and I need to select a proper tab if the currently > selected one has no invalid fields). I'm doing this via $ > ('#myform :input.error:first') query, but there is a problem: in your > code, you mark fields as invalid AFTER the invalidHandler call (line > 302): > > if (!this.valid()) $(this.currentForm).triggerHandler("invalid-form", > [this]); > this.showErrors(); > > So, as a workaround at the moment I simply call showErrors(); in my > invalidHandler, but maybe - unless you have a special reason for this > - it's better to swap these lines in the jquery.validate.js? That's > actually my $0.02 suggestion. > > cheers