pktm wrote:
Hello!

I have a fillout-form with 2 buttons in which users have to review their given information from a further form.
If the one button (named 'back') gets clicked, the user want's to change his given information.
Else, he would submit his data.
Now, I thougt i can check for the runmode ('save') given in the review-form by a hidden-field and set the correct runmode.


workflow:
fillout-form  <-----+
    |          |
    V          |
    review -->--->---+
    |          |
    V          |
submit the data or -+

Now my code:

sub cgiapp_prerun {
     my $self = shift;
     if( $self->get_current_runmode() eq 'save' ){
         my $q = $self->query();
         if( defined($q->param('back')) ){
             $self->prerun_mode('showForm');
#print STDERR $self->get_current_runmode();
             $q->param(-name=>'error', -value=>1);
         }
     }
} # /cgiapp_prerun

This doesn't work.
Anytime the button 'back' gets clicked, I saw the fillout-form AND the review-form.
The output to STDERR returns 'save', although I set it to 'showForm'...

What is the name of your submit button? Is it 'back' or is that just the value? Did you make sure that your call to prerun_mode is getting run? Put in a debug print/die/warn statment inside the if( defined($q->param('back')) ) block just to make sure.

Michael Peters
Developer
Plus Three


--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to