Hello !!!
I have a problem like these but this solution wasnt enough to solve my
problem... if you could help i will be so glad!!
Take a look at my code:
JS:
$(function() {
// valida o formulário
$('#floculador').each(function(){
$(this).validate({
// define regras para os campos
rules: {
"floculador.vazao": {
required: true,
number: true,
min:0.001
},
"floculador.comprimento": {
required: true,
number: true,
min: 0.01
}, (so go on...)
JSP: have dynamic input fields starting with just one...so when I add
them and later click to send (and the validate acts) just the first
works fine...
If i click to send and there is just one (the original input field),
and add later the validation gets all fields...
can you help me?
thanks a lot!
Gustavo
On 7 jul, 12:36, Jörn Zaefferer <[email protected]>
wrote:
> $(".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<[email protected]> 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.