On Wed, 27 Sep 2000, Nathan Wiger wrote:

> Robert Mathews wrote:

> > How are you going to handle multiple values for the same parameter?
> > With CGI.pm, you can say
> >   @values = $q->param("foo");

> 
> 2. make it a comma-delimited string:
> 
>    $name = $CGI{name};
>    @name = split ',', $name;
> 
> The problem arises if your data has commas in it. Then you're hosed. So
> door #1 might be the only solution.

Hosed indeed. One can control whether or not checkboxes, options, and radio
buttons have a comma in their value attribute. Method two fails when the
user enters "Ann Arbor, MI".

HTML::Embperl stuffs form input into a hash just as proposed here. For
multiple values it creates a tab-delimited string. This will not present
the above trouble with commas, since when the user, for some odd reason,
enters "Ann Arbor\tMI", in most browsers the input focus will jump to
the next input on tab, and the tab does not get entered into a field.

I've used HTML::Embperl a lot and I've not difficulty with series data,
and yes I've worked with checkboxes and selects. It will go a long way
for classic CGI. If the source is coming from other than a browser, or
from a scripting language within the browser it is possible to defeat
this scheme, but we are looking to keep it simple for the common case.


Reply via email to