Bug Tracker

Opened 9 years ago

Closed 9 years ago

#8023 closed bug (invalid)

Validator plugin doesnt validate dynamicaly added fields

Reported by: david.votrubec@… 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...

Change History (1)

comment:1 Changed 9 years ago by jitter

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.

Note: See TracTickets for help on using tickets.