Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: FormBuilder fails in "Multi screen mode"

by kazak (Beadle)
on Aug 23, 2012 at 11:43 UTC ( [id://989293]=note: print w/replies, xml ) Need Help??


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

You see, the idea was to import list of fields in certain table of DB and make a form in order to populate this table, when form submited cgi adds data to proper table and triggers proper script. That's why it's crucial, but if running script without DB interaction will help to clarify this situation, sure you can just use any field names you see fit, DBI used only for searching of

- environment types (e.g. app, db, ha)

- field names (e.g. serverID, status, environment)

I may wrong again but queries I've mentioned before may be replaced with:
my @keys = qw (serverID status environment); my @env_types = qw (app db ha);
Also you can comment out anything you see fit.

Replies are listed 'Best First'.
Re^5: FormBuilder fails in "Multi screen mode"
by Anonymous Monk on Aug 23, 2012 at 12:24 UTC

    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

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

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

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://989293]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found