Re: multiple submit images for one form
| From: | Matt McClanahan | Date: | Wed, 08 Nov 2000 03:28:57 +0000 |
| Subject: | Re: multiple submit images for one form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24252@lists.php.net to get a copy of this message | ||
On Tue, 7 Nov 2000, Sharon Spurvey wrote:
> I have a single form with multiple submit images. Is there anyway to
> detect which image has been clicked to submit the form?
It's not as easy as using multiple submit buttons because submit images
don't set values (A most frustrating aspect of the html spec)
What you need to do is check the x (and/or) y coordinates defined by the
image when you click on it. For example..
<input type="image" src="filename" name="First">
<input type="image" src="filename" name="Second">
<input type="image" src="filename" name="Third">
=====
if ($First_x) {
// First image clicked
}
else if ($Second_x) {
// Second image clicked
}
else if ($Third_x) {
// Third image clicked
}
Matt