I don’t know if this constitutes a usecase, but here’s my scenario..

 

I have a form which is on a panel, that moves.

This form contains a list of items which has an active and index per item.

When you click on a list item a new form appears where you can edit the details 
of the item.

 

You could position the sub-form absolutely, but the moving panel means that 
you’d have to keep a track on it and move the sub-form appropriately. It’s much 
easier to append the form to the list item and let the browser take care of 
positioning.

 

Also, I did try absolutely positioning the form and there were pixel 
differences in the three browsers I tried.

 

The real trouble is that using the jquery.validation.form() method throws an 
error

See attached, in IE 

1.     click submit first, no problem

2.     choose an item, to move the details form to the list form, boom

 

Ticket here http://dev.jquery.com/ticket/3527

 

I’m sure this will come up again, and it’s an eenie weenie fixeteenie

Ant

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn 
Zaefferer
Sent: 27 October 2008 18:30
To: [email protected]
Subject: [jquery-dev] Re: [validate] jquery validate picks up sub form elements 
in ie

 

I haven't yet seen a usecase where nested forms where actually required. Ajax 
uploads can be done by moving the file input field into a sibling form and 
uploading the file from there. So currently I see no reason to "fix" this in 
the validation plugin. If you still think it should be covered, please create a 
ticket: http://dev.jquery.com/newticket

Jörn

On Mon, Oct 27, 2008 at 6:59 PM, Anthony Johnston <[EMAIL PROTECTED]> wrote:

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
-~----------~----~----~----~------~----~------~--~---

Title: Sub-forms
  • Item 1
  • Item 2
  • Item 3

Reply via email to