A reset doesn't clear all state associated with the form validation.
You'd have to manually reset all that state, see
http://dev.jquery.com/browser/trunk/plugins/validate/jquery.validate.js#L263

Just calling validator.init() again wouldn't work well, as that is
also used to bind events and parse certain settings.

I haven't tried yet (don't have a testcase at hand), but it may be
enough to reset the submitted-property:

var validator = $(...).validate();
validator.resetForm();
validator.submitted = {};

Jörn

On Tue, Jul 8, 2008 at 5:40 PM, caseyw <[EMAIL PROTECTED]> wrote:
>
> I have a hidden form, when someone clicks on another element it shows.
>
> If you just hit submit, it validates false, and shows the proper
> errors. All is well there.
>
> I have a close button in the form, it should close the form, and
> completely reset it.
>
> What's happening is, it resets the form data, removes the error
> messages but if you
> reopen the form, the validation is aggressive. Right as you tab onto
> an element it'll
> prompt you with error messages. "Field required" and whatnot. I need
> it to act as it
> did before the initial failed submit.
>
> I'm using a form.resetForm, as well as a normal JS reset() on the
> form.
>
> Thanks!
>

Reply via email to