I've just done some testing and the "Image" type input doesn't seem to pass
its anem across as a variable at all when the form is submitted in the way a
submit button does. This is contrary to the w3c html specs. I've tested this
in nutscrape and micros**t ie5.

this is the code that doesn't work:

<?php
if (isset($fred2)) echo "fred2 set"; // only shows if submit button clicked
?>

<form action="#" method="post">

<input type=image name=fred2 src = "done.bmp" value="done0bmp">
<input type=image name=fred2 src = "tetra.bmp" value="minebmp">
<input type=submit name=fred2 value="submit">

</form>

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Tim Ward 
> Sent: 22 February 2001 09:07
> To: 'Zenith'; [EMAIL PROTECTED]
> Subject: RE: How to get information from <input type=image ...>
> 
> 
> use isset($action1) and isset($action2) to test each.
> 
> the nice way to do it would be for them to have the same name 
> but different
> values as you would do with alternative submit buttons, but I 
> haven't ever
> needed to find out how to do that and doesn't seem to be 
> quite that simple.
> 
>       Tim Ward
>       Senior Systems Engineer
> 
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
> 
> 
> > -----Original Message-----
> > From: Zenith [mailto:[EMAIL PROTECTED]]
> > Sent: 21 February 2001 17:51
> > To: [EMAIL PROTECTED]
> > Subject: How to get information from <input type=image ...>
> > 
> > 
> > Hello everbody, if a have HTML document lik this:
> > <form action = "submit_to.php">
> >     <input type="image" src="xxx" name="action1">
> >     <input type="image" src="xxx" name="action2">
> > </form>
> > 
> > How can know whether the user is pressed on the "action1" or 
> > "action2" image
> > button??
> > 
> > 
> > 
> 

-- 
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