* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)

This commit is contained in:
Jörn Zaeffferer
2009-11-30 19:50:20 +00:00
parent e062af27ea
commit ebcaa693de
2 changed files with 5 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
* Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195)
* Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144)
* Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612)
* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)
1.5.5
---

5
jquery.validate.js vendored
View File

@@ -648,7 +648,10 @@ $.extend($.validator, {
},
errorsFor: function(element) {
return this.errors().filter("[for='" + this.idOrName(element) + "']");
var name = this.idOrName(element);
return this.errors().filter(function() {
return $(this).attr('for') == name
});
},
idOrName: function(element) {