Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This information is submitted and I end with a CGI $q->param object looking like so:<input type=checkbox name='date' value='$thisyear-$thismonth-$thisday' +>
I want to loop through the date parameter in HTML::Template, but not sure how to do it... Here's what I have.$VAR1 = bless( { '.parameters' => [ 'date', 'bsubmit', 'state' ], 'use +_tempfile' => 1, '.charset' => 'ISO-8859-1', '.fieldnames' => {}, 'pa +ram' => { 'bsubmit' => [ 'Next' ], 'date' => [ '2013-05-9', '2013-05- +10', '2013-05-11' ], 'state' => [ 'add' ] }, 'escape' => 1 }, 'CGI' ) +;
And here's reqinfo.html:if ( $q->param('bsubmit') eq 'Next' ) { my $template = HTML::Template->new( filename => 'reqinfo.html', as +sociate => $q ); print $template->output; }
The problem here is that I don't know what the TMPL_VAR should be.<TMPL_IF DATE> <TMPL_LOOP DATE> <b><TMPL_VAR NAME=DATE></b> </TMPL_LOOP> <TMPL_ELSE> <b>You Did Not Select Any Days!</b> </TMPL_IF>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Template and looping through CGI param with multiple values
by walkingthecow (Friar) on Apr 12, 2013 at 03:20 UTC | |
by Anonymous Monk on Apr 12, 2013 at 03:37 UTC |