Bug Tracker

Modify

Ticket #8023 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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

comment:1 Changed 2 years ago by jitter

  • Status changed from new to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.