I spent several days on this problem, and never fixed it. Perhaps, a wise perl monk can see my problem and explain it to me.

I have a form that I use this code for:

print $cgi->start_form(-name=>'new', -method=>"$FORM_METHOD", -action=>'secalert_display.cgi', -target=>'_top'); print $cgi->submit(-value=>'Enter a new record for a Secalert'); print $cgi->hidden(-name=>'MODE', -value=>'new'); print $cgi->endform;

It compiles cleanly, but at runtime (when I execute the CGI from a browser) and click on the 'Enter a new record for a Secalert' button, It doesn't work. The best I can figure is that it doesn NOT sent the hidden field along with the rest of the stuff.

Now, if I replace this CGI.pm code with simple print statements, as in:

print("<form name='new' method='$FORM_METHOD' action='secalert_display +.cgi' target='_top'>\n"); print("<input type='submit' value='Enter a new record for a Secalert'> +"); print("<input type='hidden' name='MODE' value='new'>\n"); print("</form>\n");

It works fine. Can somebody see what the problem with the CGI.pm version is?


In reply to Whats wrong with this code. by kmullin5016

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.