Petr
Petr

Reputation: 13

ASP.NET MVC 3 jQuery client validation - disable for specific button (Ajax form)

How can I disable validation for one button inside the Ajax begin form?

Using jQuery validation I tried many ways from Google, but none of them worked (class="cancel", disableValidation attribute, etc.).

Upvotes: 1

Views: 4336

Answers (2)

sonyaa
sonyaa

Reputation: 11

$('#frmMyName').validate().cancelSubmit=true;

Upvotes: 1

Adam Tuliper
Adam Tuliper

Reputation: 30152

There may be other ways, but one for sure way is to remove all the validation rules if using unobtrusive validation via:

http://docs.jquery.com/Plugins/Validation/rules#.22remove.22rules

Upvotes: 2

Related Questions