[thelist] Phorm and Checkboxes

.jeff jeff at members.evolt.org
Tue Jan 7 00:16:01 CST 2003


keith,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Keith
>
> It's been many moons, perhaps years, since I've found
> .jeff in technical error, but this post was.
>
> [snip]
>
> This comma-delimited string of values may *appear* to
> be what was transmitted once input has been parsed by
> CF, ASP, PHP, CGI.pm or some other programmer's crutch,
> but it's not how data moves.
>
> For a multiple select, or a series of same-named
> checkboxes, each VALUE arrives at the server separately,
> with it's paired NAME. The name is not the control, the
> value determines whether the element gets sent, then
> it's name is added to that pair, without regard to
> whether there is already an exiting pair by the same
> name in queue to submit.
>
> If you capture the raw stream from STDIN you'll see a
> series of name=value pairs separated by & signs.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

interesting.  i honestly never knew that.  i've always worked with
server-side stuff that did some of the abstraction for me (didn't actually
know it was happening).  this explains a few things though.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> items=item1&items=item2&things=thing1&things=thing2
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yeah, the same sort of thing you get when you change method from post to
get.  the url has all sorts of duplicate names.  makes sense that if the
browser is sending the data that way with a get that it'd do it very
similarly with a post.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> but, that is not how the browser sends the data......
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

you learn something new every day.

that makes me want to have some control over how the same-named values are
handled.  if i had a preference they'd be saved into an array cause that's
almost always what i end up doing manually anyway, except when they've
converted into a comma-delimited list first the values themselves that
contain commas ends up being split into more than one value.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list