hesco has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: Baffled by form behavior
by Fletch (Bishop) on Dec 15, 2005 at 20:07 UTC

    Because you have a comma (,) not a semicolon (;) after your first print line.

    Update: A perl -MO=Deparse,-q,-p yourcode.plx may be enlightening as to what exactly is happening.

      Thank you so kindly sir. My eyes are crossing on this and I would never have seen that without your help. Much appreciation. I anticipate being able to deliver something working reasonably well soon due to your help.

      Thanks again.

      -- Hugh