0

I am using jQuery validation plugin for UI validation. I have a Jquery menu to select the type of transaction. On certain menu selection there should not be any validation happening. I am not sure if there is a way to tell Jquery validation to be disabled

I am using a following ways for the validation

1) $.validator.addMethod()

2) $.validator.addClassRules()

3) $("#submitButton").validate({ rules: { some rules }, messages: { some messages }

on click of the submit button for a particular menu selection i want the validation to be turned OFF. Is there a way to achieve this?

Sparky
  • 98,165
  • 25
  • 199
  • 285
Balaji
  • 2,109
  • 5
  • 27
  • 34

1 Answers1

2

This answer should be what you're looking for: add class="cancel" to your submit button when the transaction type is changed to one you don't want validated. And when it's changed to a transaction type you do want validated, just remove the class.

Community
  • 1
  • 1
Justin Stayton
  • 6,031
  • 8
  • 37
  • 43