There is a bug in the jQuery validate plugin when running in internet explorer. When the validate function is called and errors are found, the invalid label error does not show, or rather it shows, it is just empty.
After considerable digging around I found the culprit. jquery.Validate uses the function defaultMessage to determine which error message to display, it in turn calls the findDefined function to determine which of the parameters is defined and it uses that one as the message.
The bug is in findDefined function, it uses this line to determine weather to use that message or move to next one:
if (arguments[i] !== undefined) {
in internet explorer this comparison is incorrect. The correct comparison to get the desired behavior would be
if (arguments[i] != undefined) {
I’ve tested this last line in all the major browsers and it works great. Hopefully this will save you some time when debugging this particular problem.
Here is the fixed function:
findDefined: function() {for (var i = 0; i < arguments.length; i++) {if (arguments[i] != undefined) {return arguments[i];}




Posted by Oscar on October 24, 2011 at 10:44 pm
Unluckily it doesn’t fix the validation problem between jQuery Validate and Internet Explorer. Just a very simple form validation with only one field and check if this field is fielded in, Internet Explorer returns true, the other browsers return false, I don’t know why is that. I tried to set the charset to ISO-8859-1, and no, it didn’t fix.
By the way thanks for this article.
Posted by Mitch Labrador on October 25, 2011 at 7:49 pm
Sorry it did not work for you Oscar.
jQuery.Validation can be a bit troublesome sometimes.
Regards,
Mitch