Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
page1 displays properly, when submitted it brings up page 2. Page2 however has the hidden rm field set to page2.package run_mode_test; use strict; use base qw/CGI::Application/ ; use CGI qw/:standard/; sub setup { my $self =shift; $self->start_mode('page1'); $self->run_modes('page1' => 'page1', 'page2' => 'page2'); } sub page1 { my $self =shift; my $q = $self->query(); my $output = ''; $output .= $q->start_html(-title => 'Test Run Mode'); $output .= 'this is page1'; $output .= $q->start_form(); $output .= $q->hidden(-name => 'rm', -value => 'page2'); $output .= $q->submit(); $output .= $q->end_form(); $output .= $q->end_html(); return $output; } sub page2 { my $self =shift; my $q = $self->query(); my $output = ''; $output .= $q->start_html(-title => 'Test Run Mode'); $output .= 'this is page2'; $output .= $q->start_form(); $output .= $q->hidden(-name => 'rm', -value => 'page1'); $output .= $q->submit(); $output .= $q->end_form(); $output .= $q->end_html(); return $output; } 1;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI::Application is ignoring me
by Hero Zzyzzx (Curate) on Jul 21, 2005 at 02:15 UTC | |
Re: CGI::Application is ignoring me
by cees (Curate) on Jul 21, 2005 at 13:34 UTC | |
Re: CGI::Application is ignoring me
by samtregar (Abbot) on Jul 21, 2005 at 18:43 UTC | |
by mpeters (Chaplain) on Jul 21, 2005 at 18:47 UTC |