Greetings kind monks:

Here is what I've got. A script which reads in relevant part:

print start_form (-action => url()), print hidden( -name => "function", -value => "subscribe"); print hidden( -name => "process", -value => "1");
which is generating html which looks like this:

<input type="hidden" name="function" value="subscribe" /> <form method="post" action="http://electleyland.ca/supporters/supporte +rs.cgi" enctype="application/x-www-form-urlencoded"> 1<input type="hidden" name="process" value="1" /> <the rest of the form>
Although more than one of us has gone on long bug hunts looking for that spurious numeral 1, that is not what this note is about.

Due to the hidden definition of "function" falling outside of the <form></form> tags, that value is not being passed back to the dispatch logic, and this script is defaulting to my donation form, instead of proceeding to validate and process the subscription data just collected.

Any ideas why CGI might be scrambling the order of my start_form and print hidden(fields) lines?

All help is appreciated.

Thanks,
-- Hugh


In reply to Baffled by form behavior by hesco

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.