I am dynamically changing the className from required:true to required:false but jquery.validate.js always is displaying that this field is required.
function change_required(id,bRequired) { document.getElementById(id).className= (bRequired?'{required:true}':'{required:false}') } Before submit I see that input fields whose className is dynamically set to {required:false} is still be treated by jquery.validate.js as if {required:true} This is the call to validate for the form: jQuery(document).ready(function() { jQuery("#form_id").validate( { errorClass: "form_error", errorElement: "div", wrapper: "span" }); }) How do I set a rule to ONLY validate when the className has required:true?