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


In reply to TMPL_VAR with selection box by bebewinla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.