Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I beg for a favour again. I am learning cgi, and have created a few forms at this stage, and everything seems alright, but I've hit a problem. I know its possible to have two buttons in a cgi form
At the top of my script I have tried this, as suggested on some nodes:$co->submit(-name=>'edit', -value=>'edit'), $co->submit(-name=>'preview', -value=>'preview'),
And where I specify the start of the form I use this:my $name=>$co->param('name'); if ($name eq 'edit'){ $string="http://mywebserver/cgi-bin/edit.cgi"; } elsif($name eq 'preview'){ $string="http://mywebserver/cgi-bin/preview.cgi"; }
The two buttons appear alright in the form, I was hoping that they would each call the different scripts as outlined in the if/elsif statement, but they webpage just seems to refresh. If anybody could point me in the right direction, I would appreciate it a lot.$co->start_form(-method=>'POST', -action=>"$string"),
Thanks,
Jonathan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Two cgi buttons in the same form
by inman (Curate) on Mar 26, 2004 at 11:55 UTC | |
|
Re: Two cgi buttons in the same form
by Happy-the-monk (Canon) on Mar 26, 2004 at 12:32 UTC | |
|
Re: Two cgi buttons in the same form
by Plankton (Vicar) on Mar 26, 2004 at 16:21 UTC | |
|
Re: Two cgi buttons in the same form
by maa (Pilgrim) on Mar 26, 2004 at 11:46 UTC |