Jquery Validation Remove Rules Not Working
I am setting validation dynamically based on input. Before adding validation I am removing rule and adding it element is required. Message is not going away after I set rules remov
Solution 1:
Instead of removing the required
class, use the $.rules('remove',...) function:
$('[name="HomeAddress1Label"]').rules('remove',{
required:true
});
You may need to re-validate after this change as well -
$('form').valid();
Solution 2:
Looks dirty but below solution worked for me.
$("#Name").rules("remove", "required"); //Only this line did not worked in my case$("#Name").removeClass("input-validation-error");
$("#Name").next().removeClass("field-validation-error");
$("#Name").next().addClass("field-validation-valid");
$("#Name").next().children().text("");
Post a Comment for "Jquery Validation Remove Rules Not Working"