-1

Possible Duplicate:
jQuery Validation plugin: disable validation for specified submit buttons

I've got a form that is successfully using jQuery Validation to check the fields on a form creating/editing an entry on my site (a Drupal node, if you really care). I'm trying to set things up so that I get normal validation when the user clicks on the "Save" button but NOT when the user clicks on "Delete" -- there's no reason to insist on a complete form if the thing is being deleted. I'm able to catch the invalid detection in an invalidHandler clause, but I can't find the right way to tell the form submission to continue if it was the Delete button that was clicked. Any suggestions out there?

Community
  • 1
  • 1
Jim Miller
  • 3,291
  • 4
  • 39
  • 57
  • is this a javascript single page app or a normal plain web app?? – Juri Oct 06 '12 at 15:30
  • Show us the relevant code or there's not much to do here. There's no reason you can't avoid validation on the "delete" button. – Sparky Oct 06 '12 at 15:32

1 Answers1

2

The documentation states the following:

To skip validation while still using a submit-button, add a class="cancel" to that input.

So, try applying that class.

Tim Post
  • 33,371
  • 15
  • 110
  • 174
Androiderson
  • 16,865
  • 6
  • 62
  • 72