Re: image button problem
| From: | Jackson Miller | Date: | Tue, 12 Aug 2003 13:53:10 +0000 |
| Subject: | Re: image button problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159279@lists.php.net to get a copy of this message | ||
On Tuesday 12 August 2003 8:45, Abdul-wahid Paterson wrote:
[snip]
> Is there are a better way of doing this? All I want is to know which
> button has been clicked on the form. (The form has to be method=POST)
<input type="image" name="test1" src="...">
<input type="image" name="test2" src="...">
Then on the form processing script:
if ($test1_x > -1 && $test1_y > -1) {
// the test1 button was clicked
} else if ($test2_x > -1 && $test2_y > -1) {
// the test2 button was clicked
}
// It should be -1 and not 0 to account for people pressing enter with the
button submitted.
HTH
-Jackson
>
> Regards,
>
> --
> Abdul-Wahid Paterson
>
> Lintrix Networking & Communications ltd.
> Web: http://www.lintrix.net/
> Tel: +44 20 8904 2348
> Email/Jabber: aw@lintrix.net
> --------------------------------------------------------------------
> Web-Hosting | Development | Security | Consultancy | Domains
> --------------------------------------------------------------------
--
jackson miller
cold feet creative
615.321.3300 / 800.595.4401
jackson@coldfeetcreative.com
cold feet presents Emma
the world's easiest email marketing
Learn more @ http://www.myemma.com