Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

errorsFor method does not support complex names


Project:Validation
Version:1.5.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If one adds validation to a form with a complex name, such as 'something.else[0]', every time validation fails, a new error message appears, and the old ones remain. I have traced the problem to the errorsFor method, with the filter on the for attribute.

Original (breaks):

errorsFor: function(element) {
    return this.errors().filter("[for='" + this.idOrName(element) + "']");
},

Patched version (works for both cases):

errorsFor: function(element) {
    var name = this.idOrName(element);
    return this.errors().filter(function() { return $(this).attr('for') == name; });
},

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#1

Status:active» fixed

Thanks, applied the patch. Will be included in the upcoming 1.6 release.

#2

Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#3

I agree with the statement that China and the United States can together drive a global clean energy economy that may define the 21st century! Cool facts for writing a paper in college or university for scientific classes! Online Business management degree AND Online Occupational safety and health degree AND Psychology degree AND Network degree AND online phd degrees

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.