Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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: