This solution. Is it for same-named form controls? My solution doesn't
have same-named controls.

So with this i can send the return from mergeForms... as my
parameters, right?

On Nov 13, 5:26 pm, kangax <[EMAIL PROTECTED]> wrote:
> On Nov 13, 11:13 am, Abel Figueiredo <[EMAIL PROTECTED]>
> wrote:
> [...]
>
> > Seeing it's not possible to use nested forms, I need to combine the
> > information of all 3 and send it as parameters.
>
> I needed something similar some time ago. Serializing multiple forms
> is as easy as merging multiple objects. When forms have same-named
> controls, it becomes a bit more complex:
>
> function mergeForms(forms) {
>   var container = new Element('form'), clone;
>   forms.each(function(form) {
>     $(form).getElements().each(function(formControl) {
>       clone = formControl.cloneNode(true);
>       clone.id = '';
>       container.appendChild(clone);
>     });
>   });
>   var result = container.serialize(arguments[1]);
>   container = null;
>   return result;
>
> };
>
> // and then:
> mergeForms([document.forms[0], document.forms[1]], true);
>
> --
> kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to