Re: forms

From: Date: Tue, 14 Jan 2003 04:04:03 +0000
Subject: Re: forms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131510@lists.php.net to get a copy of this message
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" <cj@itonsite.com.au> To: <shiflett@php.net>; "Php-List (E-mail)" <php-general@lists.php.net> 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:shiflett@php.net] Sent: Tuesday, 14 January 2003 2:21 PM To: cj@itonsite.com.au; php-general@lists.php.net Subject: Re: [PHP] forms --- cj <cj@itonsite.com.au> 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

« previous php.general (#131510) next »