bebewinla has asked for the wisdom of the Perl Monks concerning the following question:
Here is my html file using tmpl_var to display a list of files names, selection of time, selection type
<table> <TMPL_LOOP NAME="files_loop"> <tr> <td><TMPL_VAR NAME ="index"></td> <td><TMPL_VAR NAME ="fn"> </td> <td class="form"><select name="files234p"> <option value = "0">- Select -</option> <option value = "1 ">1 Sec Delivery</option> <option value = "10 ">10 Sec Delivery</option> <input type="hidden" name="file" value="<TMPL_VAR NAME="fn">"> + </select></td> </tr></TMPL_LOOP></table>
In my cgi script, I was able to display the output in a format of a table, 1st column - index #, 2nd column-list of filenames, 3rd column- it's a selection box of "time". my problem is getting the filenames using $q->param.
foreach my $value ($q->param('files234p')) { if ($value != 0) { my $filen = $qq->param('file'); print FOUT $filen," ",$value, "\n"; $i++; } }
when I select 1st row selection box with 1 sec, then 2nd row selection box with 10 sec. 3rd file with 1 sec. my output shows :
file1 1 file1 10 file1 1 it should be : file1 1 file2 10 file3 1
I am not getting filenames correctly, it stays as the 1st one. Can any one help please. is it the $q->param incorrectly used
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: TMPL_VAR with selection box
by choroba (Cardinal) on Nov 08, 2012 at 01:48 UTC | |
by bebewinla (Novice) on Nov 08, 2012 at 02:02 UTC | |
by bebewinla (Novice) on Nov 08, 2012 at 02:04 UTC | |
|
Re: TMPL_VAR with selection box
by choroba (Cardinal) on Nov 08, 2012 at 08:37 UTC | |
|
Re: TMPL_VAR with selection box
by Anonymous Monk on Nov 08, 2012 at 02:23 UTC | |
by bebewinla (Novice) on Nov 08, 2012 at 05:27 UTC | |
by Anonymous Monk on Nov 08, 2012 at 09:48 UTC | |
by Anonymous Monk on Nov 08, 2012 at 23:28 UTC | |
by Anonymous Monk on Nov 09, 2012 at 04:59 UTC |