A input or button with a class of "cancel" will, when used to submit
the form, skip the validation. I documented that somewhere... The
relevant code is here:
http://dev.jquery.com/browser/trunk/plugins/validate/jquery.validate.js#L40

Jörn

On Fri, Jan 23, 2009 at 5:45 PM, JOR <js03...@gmail.com> wrote:
>
> I have two forms on a page.  One is a registration form and the other
> is a log-in form.  How can I disable validation when one button is
> clicked but enable it when another is clicked.  We are using .Net so
> there is only one form tag on the page but visually to the user there
> are two separate forms.
>
> I tried the following but it didn't work:
>
> jQuery('.btnTabLogin').livequery('click', function() {
>    jQuery("#Form").validate({
>       onsubmit: false
>    });
> });
>
> Then I tried the following:
>
> jQuery('.btnTabLogin').livequery('click', function() {
>    jQuery("#Form").validate({
>       errorPlacement: function (error, element) {},
>       rules: new Object(),
>       messages: new Object(),
>       submitHandler: new function() {},
>       onsubmit: false
>    });
> });
>
>
> Neither worked.  Can anyone shed some light on this for me?
>
> More ideal would be a solution to have two different validations based
> on the button clicked but I'll be happy to get it working without.
>
> Thanks in advance. JOR
>

Reply via email to