markjugg has asked for the wisdom of the Perl Monks concerning the following question:
Occassionally I run into a problem space where a good solution is to pass information though CGI-based webpages in hidden form fields. (No, not sensitive info. :). I have a feeling that CGI.pm probably has some tricks to help with this, but I can't find them. Here's some code I've used before as my own helper function:
For each of the field names passed in, it produces the appropriate hidden tags, based on the values in param().sub export_form_vars { my @input = @_; my $html = "\n"; foreach my $key (@input) { my @vars = param $key; foreach my $val (@vars) { $val = escapeHTML($val); $html .= qq { <input type=hidden name="$key" +value="$val">\n }; } } return $html }
Is there an easy way to accomplish the same thing with CGI.pm? Thanks,
-mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing information through hidden fields using CGI.pm
by damian1301 (Curate) on Feb 13, 2001 at 01:27 UTC | |
by runrig (Abbot) on Feb 13, 2001 at 02:08 UTC | |
by damian1301 (Curate) on Feb 13, 2001 at 02:40 UTC | |
by markjugg (Curate) on Feb 13, 2001 at 01:41 UTC | |
|
Re: passing information through hidden fields using CGI.pm
by geektron (Curate) on Feb 13, 2001 at 12:13 UTC |