On Mar 16, 7:39 pm, Mac <amcint...@bigmate.com.au> wrote:

> The validate plugin has a success option that enables customization of
> the valid fields on the form
> It takes a string or a function. In the validate plugin documentation
> the example is used to add a class to the label, but since it's a
> function, you could make it do ...anything.

Hi Mac, thanks for your suggestion.

The problem here is that the success handler is called after an
individual input is considered valid irrespective of the status of the
other fields in the form. For example, say I have three input fields,
A, B, and C, all of which are required. Once I fill in A to the
satisfaction of the rules, the success handler is fired...even though
B and C are empty. In order to take this approach, I'd have to use the
success handler to inspect the *entire* form to see if it is ready to
be submitted. So I tried the following:

     success: function(element) {
         console.log('checkForm: %o', validator.checkForm());
     }

But the problem is that checkForm() seems to be very side-effect
ridden. Using this approach, tabbing from input A to input B causes
the "This field is required" error message to appear below B,
complaining to the user that an input is required before he's even had
a chance to type anything into it.

I tried for a good portion of the day yesterday to figure out what
side effect is causing this to happen, but I've been thus far
unsuccessful.

-dan

Reply via email to