in HTML form:

<FORM method=post action="myscript.php">
.
.
.
<INPUT type=submit name=submita value="Do This">
<INPUT type=submit name=submitb value="Do That">
</FORM>


in myscript.php:

if(ISSET($HTTP_POST_VARS['submita']))
{
}
if ISSET(($HTTP_POST_VARS['submitb']))
{
}

----- Original Message ----- 
From: "cj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Php-List (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 9:30 PM
Subject: RE: [PHP] forms


So, if I am understanding correctly
The page that processes the form will have to work out which button got
pressed?

That should be easy enough to work out, I hope :-)


-----Original Message-----
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 14 January 2003 2:21 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] forms


--- cj <[EMAIL PROTECTED]> wrote:
> Is it possible to have two buttons and have different
> actions for each button in the same form?

No, because the action belongs to the form, not the submit
buttons (which is why action is an attribute of form).

However, you can use different names and values for the
submit buttons, so that you can tell which was pressed on
your receiving page. This way you can act accordingly,
which is probably what you wanted to know.

Hope that helps.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to