Consider the following form.
<form> <input type="text" name="mytext" /> <button type="submit" name="next">next</button> <button type="submit" name="back">back</button> </form>
In this case, we only want the jQuery validation plugin to do its thing when the ‘next’ button is clicked. If the back button is clicked we do not care about the validation.
The solution is simple. Add the CSS class ‘cancel’ to the back button.
<button type="submit" name="back" class="cancel">back</button>
I couldn’t find this in the online docs. So hence this post.