Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by walkingthecow (Friar)
on Apr 12, 2013 at 03:20 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1028266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found