> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Chuck
> Esterbrook
>
> On Thu, 24 Feb 2005 13:11:12 -0500, Matt Feifarek wrote:
> > Hi Steve.
> >
> > We remembered why we did this: it's Webkit's fault. Or perhaps it
> > is the fault of cgi.FieldStorage.
> >
> > Even if you take FormKit out of the equation, a multiple-select
> > <input> tag works this way. We can certainly "fix" this via
> > FormKit, but we thought it bad to change the behavior of the way
> > webkit handles submitted posts.
> >
> > But we agree with you; it SHOULD be consistent. It should ALWAYS be
> > a list
> >
> > Thoughts, anyone? Should we fix this 'bug' or keep it consistent
> > with WK?
>
> I'm not familiar with your FormKit, but couldn't you provide a
> setting to control the behavior? You'd have to pick a default
> behavior, but people could have it either way via the setting.
>
> And btw this does ultimately come from cgi.FieldStorage. I always
> thought it was weird, but I also thought that making a list out
> of everything was weird, too.
>
> -Chuck
>

In order for cgi.FieldStorage to convert a single request value to a list it
would have to know what control was used to display the field. Isn't this
really a "feature" of the HTTP spec? There's nothing in a POST or a GET to
describe what type of control was used in the form. If the multiselect has
one option selected, then one "field=value" combination is sent by the
browser, and if it has multiple options selected, then multiple
"field=value" pairs are sent (e.g.
"mycolors=green&mycolors=blue&mycolors=orange").

The cgi module would need to communicate with the app, while parsing the
request, to obtain the knowledge about the control used in the form, or else
the HTTP spec could be enhanced to support more information (like a naming
convention for fields ugh, but the first example I could think of).
Otherwise the cgi module can't know that "mycolors" came from a multiselect
(or series of checkboxes, etc) and should be a list even if only one value
is provided in the request for that field.

Sounds like the type-unification function is a job for FormKit - sadly, I
don't use FormKit so I can't speak about it's architecture :( -,  or the app
itself can handle it with a simple utility function to coerce a single
request value into a list if it's expected to be a list.

Peace - Ben




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to