RE: [PHP] FORM <input type=image ...> with a posting value
| From: | Johnson, Kirk | Date: | Fri, 06 Apr 2001 19:28:39 +0000 |
| Subject: | RE: [PHP] FORM <input type=image ...> with a posting value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-47496@lists.php.net to get a copy of this message | ||
Yes, but you no longer check the value of "value" to determine which button
was clicked. Instead, give each button a unique *name* attribute, then check
if $name_x is set. The browser returns the x,y coordinates of the point
where the user clicks the button, in variables named name_x and name_y.
So,
<input type=submit name="modeEdit" value="Edit Contacts">
<input type=submit name="modeAdd" value="Add Products">
if($modeEdit_x)
blah
elseif ($modeAdd_x)
blah
Kirk
> -----Original Message-----
> From: Jared Howard [mailto:webbie@deanox.com]
> Sent: Friday, April 06, 2001 1:07 PM
> To: php-general@lists.php.net
> Subject: [PHP] FORM <input type=image ...> with a posting value
>
>
> I have a page with multiple form submit buttons that carry
> different values
> to do different functions and such.
>
> <form name="bidfile" method=post action="<?=$ME?>">
> <input type=submit name="mode" value="Edit Contacts">
> <input type=submit name="mode" value="Add Products">
> <input type=text name="something" value="<?=$something?>">
> ...
> </form>
> Which works great!! However, I grow tiresome of the typical
> button "look",
> and in my attempt to use an image instead:
>
> <input type=image name="mode" value="Edit Contacts"
> src="contacts.png">
>
> failed. Is there a way to do this?