Re: Re: MULTIPLE SUBMIT BUTTONS
| From: | Shawn McKenzie | Date: | Sat, 10 May 2003 19:18:10 +0000 |
| Subject: | Re: Re: MULTIPLE SUBMIT BUTTONS | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147141@lists.php.net to get a copy of this message | ||
From the HTML 4.01 spec, input type=image only returns x and y but it
prepends name_ to x and y vars, meaning with your images, you get SUBMIT1_x
SUBMIT1_y and SUBMIT2_x SUBMIT2_y respectively. So just check for the
existence of those.
if(isset(SUBMIT1_x)) {
something...
}
elseif(isset($SUBMIT2_x)) {
something else...
}
-Shawn
"Dale" <DaleHersh@hotmail.com> wrote in message
news:20030510190529.63947.qmail@pb1.pair.com...
> Thanks,
> Jason
>
> I guess one way to get around this problem is to use the x & y coordinates
> that are passed up of each submit button. But it seems pretty silly that
you
> can't directly use the submit buttons name to locate the value. Have you
> ever run into this problem?
> Thanks,
> Dale
> "Jason Wong" <php-general@gremlins.biz> wrote in message
> news:200305110253.35053.php-general@gremlins.biz...
> > On Sunday 11 May 2003 02:37, Dale wrote:
> >
> > > I have the button working just fine when I used the standard button:
> > > <input type=submit name="SUBMIT1" VALUE="Save & Close">
> > >
> > > When I, however, try to use a button that is a image:
> > > <INPUT TYPE=IMAGE
> SRC="../../../IMAGES/EMPLOYEE_MNGR/BUTTON/SAVECLOSE1.GIF"
> > > NAME="SUBMIT1" VALUE="Save and Close">
> > >
> > > next page:
> > > echo $_POST['SUBMIT1']; //with register_globals on would be $SUBMIT1
> > >
> > > IT FAILS.
> >
> > Use print_r($_POST) to see what variables you can work with.
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > ------------------------------------------
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-general
> > ------------------------------------------
> > /*
> > /* First check any supplied i/o locations. User knows best. <cough> */
> >
> > - comment from drivers/net/ne.c
> > */
> >
>
>