Skip to content

Commit 9b964ee

Browse files
mlynchjzaefferer
authored andcommitted
Deoptimize findByName for correctness. Fixes jquery-validation#82 - $.validator.prototype.findByName breaks in IE7
1 parent 278d3f3 commit 9b964ee

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

jquery.validate.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,7 @@ $.extend($.validator, {
733733
},
734734

735735
findByName: function( name ) {
736-
// select by name and filter by form for performance over form.find("[name=...]")
737-
var form = this.currentForm;
738-
return $(document.getElementsByName(name)).map(function(index, element) {
739-
return element.form === form && element.name === name && element || null;
740-
});
736+
return $(this.currentForm).find('[name="' + name + '"]');
741737
},
742738

743739
getLength: function(value, element) {

0 commit comments

Comments
 (0)