Alex,
I am having the same issue. I have been working on this for hours, and
I might have a solution. Hopefully, somebody more knowledge about how
the Validate plugin works can speak up and help us both.

What I found is that if a field (input, select, etc) has not been
validated yet, it calls the optional method, which in turn calls the
required method to check if the field is empty. To get around this, I
override the optional method to NOT call the required method to check
the field length. I'm sure this will cause other issues, but it is a
start.

I just added the following to my page's javascript file.

jQuery.validator.prototype.optional = function(element) {
    // no longer calling required to check string size
    // return !$.validator.methods.required.call(this, $.trim
(element.value), element) && "dependency-mismatch";
    return false;
};

If you find a better solution, please let me know.
Josh

On Oct 9, 9:09 am, Alex <alex.ha...@biglotteryfund.org.uk> wrote:
> Hi
>
> I am trying to use jquery:validationplugin by Jörn Zaefferer. Which
> works really well I have to say.
>
> The one limitation I am trying to work around is how I can 
> runvalidationforrequiredfields before I submit a form.
>
> At the moment I have to submit the form before I see the error
> messages forrequiredfields I would like to see them prior as the
> user tabs through the form.
>
> Thanks in advance
>
> Alex

Reply via email to