$(".commForm").each(function() { $(this).validate(); }); The call to validate works only with the first selected element, so you have to do an explicit loop.
Jörn On Tue, Jul 7, 2009 at 3:34 PM, mnaveed<mnaveed...@gmail.com> wrote: > > Hi, > I am using the JQuery validation plug in for form validations. My page > contains a loop in which dynamic forms are generated and within each > form some text fields are also dynamically generated. I have assigned > the id and name attributes both to form and fields with dynamically > appending a value. > Now I want to apply the validation on all these form, please note that > each form contains its own submit button. > I have tried using the following selector, > > $('[class^="commForm"]').validate(); // I assigned a class > 'commForm' to all the dynamic form. > $('[id^="commForm"]').validate(); // I assigned id which > starts > with 'commForm' to all the dynamic form. > but none of the above works. > > Can anyone please help me in this? > > Thanks. >