Probably a goofy question, but I can\'t seem to find anything in google land. I simply need one of my methods to ignore the case of the entered field. I am doing a city name mat
You could even create a more generic jQuery validation rule which can be reused to perform a case insensitive comparison like
$.validator.addMethod("equalToIgnoreCase", function (value, element, param) {
return this.optional(element) ||
(value.toLowerCase() == $(param).val().toLowerCase());
});
which can then be used for the following two sample inputs
like
$("form").validate({
rules: {
firstname: {
equalToIgnoreCase: "input[name=username]"
}
},
messages: {
firstname: {
equalToIgnoreCase: "The 'firstname' must match the 'username'"
}
});