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

As you see I've added "use DataDumper" into my code in order to see what may be wrong with variables, in particular with "$mode" but for me, it seems correct: "mode=servers" or "mode=env" but please correct me if I wrong.

Sorry, I can't. I don't have a mysql database .... the idea is for you to use Dumper to generate sample data, so you can run the program without a database , I mean I can run the program without a database

  • Comment on Re^3: FormBuilder fails in "Multi screen mode"

Replies are listed 'Best First'.
Re^4: FormBuilder fails in "Multi screen mode"
by kazak (Beadle) on Aug 23, 2012 at 11:43 UTC
    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.

      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"