hello siim,
i have worked on something similar lately but used a different syntax:
add_article_link_url_list.1.link
that is to say '.' instead of '[]'.
And then use
http://code.google.com/p/gvascript/source/browse/src/protoExtensions.js#Hash.expandmethod
to restructure your flat tree into a deep one.

Hash.expand($('my_form').serialize(true));


cheers

--
mona


On Wed, Feb 3, 2010 at 2:13 PM, ColinFine <colin.f...@pace.com> wrote:

>
>
> On Feb 1, 12:44 pm, Siim <coldb...@gmail.com> wrote:
> > Hello.
> >
> > I have a form that has elements
> >
> > <input type="hidden" name="add_article_link_url_list[1][link]"
> > id="add_article_link_url_list" value="1" />
> > <input type="hidden" name="add_article_link_desc_list[1][url]"
> > id="add_article_link_desc_list" value="1" />
> >
> > <input type="hidden" name="add_article_link_url_list[2][link]"
> > id="add_article_link_url_list" value="2" />
> > <input type="hidden" name="add_article_link_desc_list[2][url]"
> > id="add_article_link_desc_list" value="2" />
> >
>
> In HTML the 'name' attribute is simply a CDATA - it has no inner
> syntax.
>
> As far as Javascript is concerned "add_article_link_url_list[2][link]"
> and "add_article_link_desc_list[2][url]" are just two names which
> happen to coincide except in a few characters.
>
> It is I believe only PHP which treats [ ] in input names specially and
> forms them into arrays.
>
> Unless Prototype mimics this behaviour (and I don't think it does)
> they will be treated as independent names. If you want to form objects
> from them you'll have to parse them yourself (or maybe there are
> Javascript libraries out there which will do it).
>
> --
> 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-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
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-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to