Hello, I have got multiple checkboxes on a form with dates pulled from a form like this:
... <form method="post" action="$ENV{'SCRIPT_NAME'}?action=add_2&Month=$se +lected_month&Year=$selected_year"> <table align="center" border="0" cellpadding="1" cellspacing="0" width +="100%"> ~; print qq~<tr>\n~; @data = (PTG1, PTG2, PTG3, PTG4, F1, F2, F3, F4, R1, R2, R3, R4, J +S1, JM2, JL3, JX4); foreach $key(@data) { print qq~<td><b>$key</b></td>\n~; } print qq~</tr> <tr> ~; foreach $key(@data) { print qq~<td> <select name="$key" size="13" multiple> <option value="-1" selected></option> ~; $days_in_this_month = $days_in_month[$input{'Month'}]; if ( $input{'Month'} == 2 and leap_year($input{'Year'})) { $d +ays_in_this_month = 29; } for ($i=1; $i<=$days_in_this_month; $i++) { print qq~<option value="$i">$i</option>\n~; } print qq~</select> </td> ~; } print qq~</tr> </table> <center> <input type="submit" name="submit"> <input type="reset"> </center> </form> ...
How can I get the complete input of the form and write it into a file without using cgi.pm? I tried it with something like this, but that doesn't work:
... open (DAT, ">$db_file"); if ($flock eq "y") { flock DAT, 2; } for ($i=1; $i<=$days_in_this_month; $i++) { print qq~$i. $input{'Month'}. $input{'Year'}~; foreach $i (1..16) { foreach $i (keys (%input)) { if ($input{'$i +'} == -1) { $input{'$i'} = "---"; } else { $input{'$i'} = "$name"; } print qq~|$input{'$i'}~; } } print DAT qq~\n~; } ...
As you can see I'm a complete perl-newbie and would be very grateful for any help ;-)

In reply to Multpile checkbox handling? by Anonymous Monk

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.