RE: [PHP] Two Actions in a Form?
| From: | Vail, Warren | Date: | Wed, 26 Nov 2003 17:51:02 +0000 |
| Subject: | RE: [PHP] Two Actions in a Form? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-171113@lists.php.net to get a copy of this message | ||
Not sure I would get stuck on two actions (which implies two forms on a
page, perfectly legal, but you need to use JavaScript and hidden fields if
the two forms need to submit the same data elements).
You might find an easier approach would be to place two submit buttons on
the same form (with one action) and have that routine recognize which submit
button was pressed, either by looking at the name
if(is_set($_POST["buttonname"])) xxxxx
or the value (also uses as button text)
if($_POST["go"] == "1st button") xxxx
elseif($_POST["go"] == "2nd button") xxxx
In this example both buttons have the same name.
hope this gives you a few more options.
Warren Vail
-----Original Message-----
From: Dimitri Marshall [mailto:webmaster@dyntdesign.com]
Sent: Wednesday, November 26, 2003 9:43 AM
To: php-general@lists.php.net
Subject: [PHP] Two Actions in a Form?
Hi there,
I realize this is a group for PHP, but this question is related.
What I want to do is have one action in a form execute if the user clicks on
one button, and another action execute if the user clicks on another button.
The actions will point to PHP programs.
Can someone fill me in on what the HTML is for this. I can't remember.
Thanks a bunch in advance,
Dimitri Marshall
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php