Re: multiple submit buttons

From: Date: Sat, 25 Nov 2000 12:54:17 +0000
Subject: Re: multiple submit buttons
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27136@lists.php.net to get a copy of this message
Others are making this WAY more complicated than it needs to be. <FORM METHOD="post" ACTION="<? echo $PHP_SELF; ?>"> File Name: <INPUT TYPE="text" NAME="filename"><br> <INPUT TYPE="submit" NAME="button" VALE="Submit"> <INPUT TYPE="submit" NAME="button" VALE="Delete"> </FORM> Then at the top put: <? switch($button){ case 'Submit': // do submit stuff break; case 'Delete': // do delete stuff break; } ?> No hidden fields are required, no extra processing either - it's a pretty simple task AFAIK. --Joe On Sat, Nov 25, 2000 at 01:39:04AM -0600, Deepak Chawla wrote: > Hi all, > > I need two submit buttons in a html form, and i need them to do two > different things...eg: a text box for a filename and two submit buttons, > one for opening the file and another for deleting it. Since both require > the filename field.. both have to be submit buttons. > html in itself doesn't provide means for doing this... is there any way > to do it ?? > > regards > -deepak > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ Need a programmer? http://www.google.com/search?q=joe+stump+resume

« previous php.general (#27136) next »