Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: HTML::Template and looping through CGI param with multiple values

by walkingthecow (Friar)
on Apr 12, 2013 at 03:20 UTC ( #1028266=note: print w/ replies, xml ) Need Help??


in reply to HTML::Template and looping through CGI param with multiple values

This is my question. I thought I was logged in, turns out I was not. Anyway, I can do this like so:

my @dates=$q->param("date"); my @loop_date=(); while (@dates) { my %row_data; $row_data{DATE} = shift @dates; push(@loop_data, \%row_data); } $template->param(THIS_LOOP => \@loop_data); }
And then in my reqinfo.html file:
<TMPL_IF THIS_LOOP> <TMPL_LOOP THIS_LOOP> <b><TMPL_VAR NAME=DATE></b> </TMPL_LOOP> <TMPL_ELSE> <b>You Did Not Select Any Days!</b> </TMPL_IF>
I can do it that way, but I'd like to know if I can just associate $q (my CGI object) and loop through the values of the date param somehow. That is something I am still curious about.


Comment on Re: HTML::Template and looping through CGI param with multiple values
Select or Download Code
Re^2: HTML::Template and looping through CGI param with multiple values
by Anonymous Monk on Apr 12, 2013 at 03:37 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-07-13 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (244 votes), past polls