FreeHostia Forums https://forum.freehostia.com/ |
|
CGI Perl - changing action and mode variables https://forum.freehostia.com/viewtopic.php?f=7&t=66348 |
Page 1 of 1 |
Author: | Bremdan220 [ Wed Oct 12, 2022 11:44 am ] |
Post subject: | CGI Perl - changing action and mode variables |
I am somewhat of a novice with CGI Perl and am working on a web app that uses 'mode' and 'action' variables to determine which pages load. $mode = param('mode'); $action = param('action'); if ($mode eq 'page1') { if ($action 'eq') { &performAction; } displayPage1; } elsif ($mode eq 'page2') { &displayPage2 } During development I have been having trouble figuring out the best way to set these variables when trying to navigate to different modes/actions after a form submit. In some cases, putting a hidden value in the form will work hidden(-name=>'action',-value=>'save') but sometimes it will not. In case of the latter, putting param('action',"save") before the form will make the action change when the form is submitted. I am unable to figure out why this happens though, are there factors that affect these two variables that I am unaware of? What I now need to do is have two buttons on the same form, one which will just set the action to save the form data, and another which will save the form data but navigate to another mode/page with that form data. If anyone could at least point me in the right direction for what I should be researching I would be greatly appreciative. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |