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:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 1:07 PM
> To: [EMAIL PROTECTED]
> 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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to