I have a calendar where user's can check boxes per date. The checkbox looks like so:
<input type=checkbox name='date' value='$thisyear-$thismonth-$thisday'
+>
This information is submitted and I end with a CGI $q->param object looking like so:
$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' )
+;
I want to loop through the date parameter in HTML::Template, but not sure how to do it... Here's what I have.
if ( $q->param('bsubmit') eq 'Next' ) {
my $template = HTML::Template->new( filename => 'reqinfo.html', as
+sociate => $q );
print $template->output;
}
And here's reqinfo.html:
<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>
The problem here is that I don't know what the TMPL_VAR should be.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.