Skip to main content

Bug Tracker

Side navigation

#8023 closed bug (invalid)

Opened January 20, 2011 12:34PM UTC

Closed January 20, 2011 01:32PM UTC

Validator plugin doesnt validate dynamicaly added fields

Reported by: david.votrubec@gmail.com Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

I have a form with fields added dynamicaly. These fields have class 'lookupField' and custom method added to validator like in this example:

jQuery.validator.addMethod('lookupField', function (value, element) {
    console.log('lookup validation test');
    console.log(element);
    return false;
}, 'lookupField error msg');

When I submit the form, validator is called, and it should call lookupField() method on each lookupField input. But it calls it only on the first field, which was already in DOM when page was loaded.

It seems that is is never called on those dynamicaly added elements...

Attachments (0)
Change History (1)

Changed January 20, 2011 01:32PM UTC by jitter comment:1

resolution: → invalid
status: newclosed

The jQuery bug tracker is not for support requests, this tracker you submitted your bug on is for jQuery core bugs only.

Please try the #jquery irc channel on freenode or use the jQuery Forum for support requests.


Btw the big red box on the "New Ticket" page rather clearly states:

>For all other jQuery plugins:

This is NOT the correct form! Please use the Plugins site to report your bug to its author.