in reply to Re^4: FormBuilder fails in "Multi screen mode"
in thread [Resolved]FormBuilder fails in "Multi screen mode"

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 ... }

Replies are listed 'Best First'.
Re^6: FormBuilder fails in "Multi screen mode"
by kazak (Beadle) on Aug 23, 2012 at 12:46 UTC
    Thanks, I'll look on my code again. May be I confused you with my vague explanations, but your example is not reflecting what I'm trying to do. I here it is: Example: "Multi screen mode"

      May be I confused you with my vague explanations, but your example is not reflecting what I'm trying to do.

      Sure it is.

        Thank you, I resolve this problem. In example that I gave you one parameter was missing :"params => $query", I found it out from docs you gave me, thanks.