How to make a 'cancel' button not trigger the forms validation?
I'm using asp.net MVC with the jquery validation plugin.
How to make a 'cancel' button not trigger the forms validation?
I'm using asp.net MVC with the jquery validation plugin.
Simply give it a cancel
class:
<input type="submit" class="cancel" value="Submit without validation" />
You can define the validation group of the elements you're validating, as well as the buttons. http://www.dotnet-guide.com/validationgroups.html
Validation? Do you mean submission? If you want to cancel a form's submission, you have to return false on the form's submit event. See here: