Hi! I have a variable number of multiple choice select lists each list having each own different values.From each list I select one or more values and send them with a form to a script. In this final script I want to print all the values I selected!Here is the code for the multiple choice lists:
open(FILE, "$data_file") || die("Could not open file: $!"); @param=<FILE>; close<FILE>; foreach $line(@param){ chomp ($line); print "<br><br><br><br><b>The current list of the parame +ter <font color=#FF6600>$line</font></b><hr>\n"; my $i="$line.txt"; my $new_param="/data/aww/cgi-bin/$i"; #for each line re +presents a parameter and for each parameter I open coresponding text +file with it's values print "<table>\n"; print "<select multiple name=\"$line\" size=4>\n"; open(FILE1, "$new_param") || die("Could not open file: + $!"); @val=<FILE1>; close<FILE1>; foreach $newline(@val){ chomp ($newline); print "<option value=\"$newline\">$newline\n"; } print "</select></td></tr></table>\n"; print "<input type=\"hidden\" name=\"$line\" value +=\"$newline\">"; }
In the $data_file I have smth like this:
State Code Server
I don't know how to print all the values selected in another cgi script. Thank you for your time.

In reply to multiple-choice selects by bory

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.