Hi,

> ...I do agree that your answer
> was slightly OT and a tad condescending....

I'm sorry if it came off that way, please accept my apologies.  With
respect, I think you're misreading though:  It's quite the opposite,
I'm genuinely asking if there's something about HTML forms that I've
been missing.  I thought I made that clear in the paragraph starting
with:

> > Usually a gap like this -- where a number of people are doing
> > something I've never heard of and can't find a reference for -- means
> > I've missed something somewhere along the line.

I even gave an example where that had happened before and I'd learned
from it.

> ...if you read the bottom of this page
> http://www.prototypejs.org/api/form/serializefrom the API of the
> framework for which this group was created.

Thanks for pointing that out -- I assume you mean this comment:

<< Keep in mind that "hobbies" multiple select should really be named
"hobbies[]" if we're posting to a PHP or Ruby on Rails backend because
we want to send an array of values instead of a single one. >>

This is *exactly* what I meant about me missing something.  I wouldn't
expect the PHP or Ruby folks to be using brackets if they aren't
allowed, but the references I've found so far suggest they aren't.
Can someone point me to a standards reference for this?

> I am new here and you're obviously the top poster...

Wow, I didn't realize that.  It's only because this group is a new
replacement for the old group[1] and I've been pretty active lately.
All time I think it's still Christophe. :-)

[1] http://groups.google.com/group/rubyonrails-spinoffs

> ...I'm the
> one who'll be made to look like a fool.

I certainly hope not.
--
T.J. Crowder
tj / crowder software / com


On Oct 16, 8:49 am, delishus <[EMAIL PROTECTED]> wrote:
> I apologize for my poor terminology, but I do agree that your answer
> was slightly OT and a tad condescending....but thanks for taking the
> time anyway.  I've been using this method for some time and I'd assume
> I'm not the only one if you read the bottom of this 
> pagehttp://www.prototypejs.org/api/form/serializefrom the API of the
> framework for which this group was created.  There were also changes
> made to prototype.js to deal with these "arrays" (http://
> dev.rubyonrails.org/ticket/7516).
>
> I am new here and you're obviously the top poster, so I accept I'm the
> one who'll be made to look like a fool.
>
> If anyone else has had a similar situation with these "arrays" and has
> an alternative solution they can recommend, please let me know.
>
> Basically the input boxes are created dynamically, so when a user
> clicks "add another hobby", an additional <input type="text"
> name="hobby[]" value=""> gets added to the div. Hence my use of the
> "hobby[]".  In php I can read this as an array, implode the data and
> add it to the database.
>
> Thanks
>
> On Oct 16, 12:01 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > This may be slightly OT, but people post things periodically with
> > these "arrays" of form controls.  Believe it or not, I've managed to
> > get through several years of web programming without having heard
> > anything official suggesting that you *can* have "arrays" of form
> > controls.  (Radio buttons aren't arrays, but they do that funny thing
> > where they "share" their control name.[1])  Are these names in the
> > form "hobbies[]" really valid?  I don't see any mention of control
> > arrays in the W3 docs for the "name" attribute of input elements[2].
> > The "name" attribute is listed as being CDATA, the discussion of the
> > CDATA[3] calls out the "name" attribute specifically, saying "...ID
> > and NAME tokens must begin with a letter ([A-Za-z]) and may be
> > followed by any number of letters, digits ([0-9]), hyphens ("-"),
> > underscores ("_"), colons (":"), and periods (".")."  So no brackets
> > then.
>
> > Usually a gap like this -- where a number of people are doing
> > something I've never heard of and can't find a reference for -- means
> > I've missed something somewhere along the line.  (My first experience
> > of running into JavaScript object literal format was like that; at the
> > time I hadn't read the spec and was *totally* flummoxed by what I
> > saw.  Made me seek out and read the spec.)
>
> > If this is one of those situations, could someone point me at the
> > relevant reference so I can bone up? :-)
>
> > If not, though, that may be your answer:  They're invalid names.
>
> > [1]http://www.w3.org/TR/html401/interact/forms.html#radio
> > [2]http://www.w3.org/TR/html401/interact/forms.html#control-name
> > [3]http://www.w3.org/TR/html401/interact/forms.html#adef-name-INPUT
>
> > HTTH,
> > --
> > T.J. Crowder
> > tj / crowder software / com
>
> > On Oct 15, 6:39 pm, delishus <[EMAIL PROTECTED]> wrote:
>
> > > Hi......wonder if anyone can point me in the right direction with this
> > > issue.
>
> > > I'm using serialize to send form data to an ajax.Updater (to php
> > > backend), but the form contains array data and any fields such as
> > > name="hobbies[]" (square brackets) returns hobbies%5B%5D hence killing
> > > the post.  IE processes the form fine but Firefox and Safari fail on
> > > this issue.
>
> > > Am I missing something obvious or does someone have a solution for
> > > this?
>
> > > Thanks!- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
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