views:

76

answers:

1

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?

+1  A: 

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.

Justin Stayton