Thanks!
On Jan 9, 2:18 am, "Jörn Zaefferer" <[email protected]> wrote: > The new element has the same name as the existing one, while the validation > plugin requires unique names. You'd have to add an index to each name to get > this to work, eg. item_title[0], item_title[1] etc. > > For another example on generating > those:http://jquery.bassistance.de/validate/demo/dynamic-totals.html > > Jörn > > On Fri, Jan 9, 2009 at 12:34 AM, Rob <[email protected]> wrote: > > > Hi Jörn, > > > I have been plugging away at this for a while now, with no luck. I > > set up a test page, and stripped it down to be as basic as possible > > (it's much more basic than even the demos). It is located here: > >http://cymantix.net/validation > > > When you add new items, they don't appear to be validated along with > > the other fields. Could I trouble you to take a quick peek at my test > > page? > > > Thanks, > > > Rob > > > On Jan 6, 2:34 am, "Jörn Zaefferer" <[email protected]> > > wrote: > > > The validation plugin binds various events to the form, handling > > everything > > > that bubbles up from its form elements. So you don't have to add any > > event > > > binding after adding new elements, just make sure the validation rules > > are > > > present. If it isn't working, its probably a different issue. > > > > Jörn > > > > On Mon, Jan 5, 2009 at 11:26 PM, Rob <[email protected]> wrote: > > > > > Thanks Brian, > > > > > At the moment I'm using basically the simplest implementation of the > > > > plugin. I'm using inline rules, so I don't have to worry about the > > > > brackets yet. I do understand the event delegation, I had thought > > > > that calling $("#form").validate() again after inserting the elements > > > > would do the trick, but no such luck. > > > > > Rob > > > > > On Jan 5, 1:12 pm, brian <[email protected]> wrote: > > > > > On Mon, Jan 5, 2009 at 2:40 PM, Rob <[email protected]> > > wrote: > > > > > > > Hi Jörn or anyone else familiar with this plugin, > > > > > > > First off, thanks for the great validation plugin. I hope I do not > > > > > > impose too much with this question. > > > > > > > I have a dynamic form with fields named using brackets ([]). > > > > > > See this note: > > > >http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl. > > .. > > > > > > > Validation is working for fields that existed on the initial page > > > > > > load, but when I add append the code for a new field, the > > validation > > > > > > events are, of course, not attached to the new DOM elements. > > What's > > > > > > the best way to accomplish this? > > > > > > Make sure you understand event delegation. There's some info in the > > > > > docs. Basically, you need to ensure that any newly-created elements > > > > > are bound to event handlers. You can either bind them when they are > > > > > added or bind the container and findthe specific element in your > > event > > > > > handler by getting event.target. > > > > > > Though, I've no idea how to do this with the Validation plugin, > > > > specifically.

