That's why it's crucial, ... Also you can comment out anything you see fit.

If the DBI parts aren't what you're debugging, you too can omit that portion from your question :)

Some call it cleaning your room, but it is basic debugging, even for CGI/for CGI

Ok, trying that

#!/usr/bin/perl -- use strict; use warnings; use CGI::FormBuilder; { my $env_choose = CGI::FormBuilder->new( fields => [qw(env_type env_state)], header => 1, method => 'post', keepextras => 1, ); if ($env_choose->submitted) { print $env_choose->confirm; } }

But this oddly produces NO OUTPUT

$ perl fbhuh $ perl fbhuh env_type=something env_state=something EXTRA=STUFF

Hmm, it doesn't die, it just produces no output

Hmm, only one print statement in a conditional , what happens if  $env_choose->submitted is false?

Add code

else { print $env_choose->render; }
[download]

Run it  $ perl fbhuh env_type=something env_state=something EXTRA=STUFF

and it outputs something

Content-Type: text/html; charset=iso-8859-1 <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_U +S"> <head> <title>Fbhuh</title> </head> <body bgcolor="white"> <h3>Fbhuh</h3> <!-- Generated by CGI::FormBuilder v3.08 available from www.formbuilde +r.org --> <form action="fbhuh" method="post"> <div><input id="_submitted" name="_submitted" type="hidden" value="1" +/></div> <div><input id="EXTRA" name="EXTRA" type="hidden" value="STUFF" /></di +v> <table> <tr valign="top"> <td>Env Type</td> <td><input id="env_type" name="env_type" type="text" value="somethin +g" /></td> </tr> <tr valign="top"> <td>Env State</td> <td><input id="env_state" name="env_state" type="text" value="someth +ing" /></td> </tr> <tr valign="top"> <td align="center" colspan="2"><input id="_submit" name="_submit" ty +pe="submit" value="Submit" /></td> </tr> </table> </form> </body> </html>

And run it again, this time simulating submitting of the form $ perl fbhuh env_type=something env_state=something EXTRA=STUFF _submitted=1

Content-Type: text/html; charset=iso-8859-1 <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_U +S"> <head> <title>Fbhuh</title> </head> <body bgcolor="white"> <h3>Fbhuh</h3> Success! Your submission has been received Thu Aug 23 05:03:37 2012. <!-- Generated by CGI::FormBuilder v3.08 available from www.formbuilde +r.org --> <form action="fbhuh" method="post"> <div><input id="_submitted" name="_submitted" type="hidden" value="2" +/></div> <div><input id="EXTRA" name="EXTRA" type="hidden" value="STUFF" /></di +v> <table> <tr valign="top"> <td>Env Type</td> <td><input id="env_type" name="env_type" type="hidden" value="someth +ing" />something</td> </tr> <tr valign="top"> <td>Env State</td> <td><input id="env_state" name="env_state" type="hidden" value="some +thing" />something</td> </tr> </table> </form> </body> </html>

Oh look, it printed the confirmation screen

So it looks to me like you're not following the usage pattern closely enough  if( $form->... ){ print $form... } else { print $form ... }


In reply to Re^5: FormBuilder fails in "Multi screen mode" by Anonymous Monk
in thread [Resolved]FormBuilder fails in "Multi screen mode" by kazak

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.