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; }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |