arturo has asked for the wisdom of the Perl Monks concerning the following question:
OK, I'm stumped, and I can't figure out how to do this *easily* from the CGI.pm documentation.
The problem: I want to get a variable-length list of data from an HTML form where I don't know in advance what the data's going to be. That is, while I know each element is going to be a string, I can't predict in advance what those strings will be and how many of them there will be. in PHP (make the sign of the cross if you have to), The HTML would look like this:
(imagine several of these) and when the form is submitted, the variable $location would be an array whose elements are the various strings that were submitted.<input type='checkbox' name='location[]' value='$string'> ...
Can I do something similarly easy in Perl, or am I going to have to resort to some kind of trickery in the script that generates the HTML form?
Philosophy can be made out of anything -- or less
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing arrays to a CGI
by Fastolfe (Vicar) on Sep 20, 2000 at 23:19 UTC | |
by arturo (Vicar) on Sep 20, 2000 at 23:26 UTC | |
|
(Ovid) Re: Passing arrays to a CGI
by Ovid (Cardinal) on Sep 20, 2000 at 23:26 UTC | |
|
Re: Passing arrays to a CGI
by elwarren (Priest) on Sep 21, 2000 at 19:15 UTC | |
|