Your right, it comes about when you have a structure where 

you want to provide a sub form for details of items in a list 

which is in a form or using something like ocupload, where 

a subform is put in place of an input[type=file].

 

But the point is really that the current jquery property used 

ie form.elements, yields a different result in different browsers

 

Ant

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Diego A.
Sent: 27 October 2008 17:48
To: [email protected]
Subject: [jquery-dev] Re: [validate] jquery validate picks up sub form
elements in ie

 

Feel free to correct me if I'm wrong but I'm pretty sure that's not valid
code. You shouldn't have a form within a form...

2008/10/27 Anthony Johnston <[EMAIL PROTECTED]>

I have a problem whereby the validate function picks up :inputs in a sub
form, but only in IE

 

<form>

                <input name=one />

                <input name=two />

<form>

                <input name=three />

                <input name=four />

                </form>

</form>

 

In ie

form.elements.length == 4

 

In others

form.elements.length == 2

 

to get round it you could remove elements matching "form :input"

 

line 413 in jquery.validate.js

return $(this.currentForm)

.find(":input")

      .not($(this.currentForm).find("form :input"))

      .not(":submit, :reset, :image, [disabled]")

      .not(this.settings.ignore)

      .filter(function() {

            .

      });

 

The same thing also happens in serializeArray, so extra fields are sent on
form submits

 

Has anybody else come across this?

 

Ant

 

 

 




-- 
Cheers,
Diego A.
Emo Philips  - "My computer beat me at checkers, but I sure beat it at
kickboxing." 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to