Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-07-07 10:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls