I am using jQuery validation in ASP.NET MVC 3. Is there a possibility to check if an input is valid without showing the error messages next to the actual input?
I have tried:
$("#myForm").validate().element("#myInput1"); // this shows the error message only for the myInput1 element
$('#myForm').valid(); // this shows the error messages for all fields.
I am not trying to suppress the errors showing forever, I just want to check if the fields are valid by using the validation created on server. That one is subject to change so I do not want to have two validation definitions (one on client and one on server). Thanks!
Later Edit:
var a = $('#myForm').validate({
errorPlacement: function(error,element) {
return true;
}
}).element("#myInput1");
alert(a);
This also shows the errors.