RE: How to get information from <input type=image ...>
| From: | Tim Ward | Date: | Thu, 22 Feb 2001 15:59:04 +0000 |
| Subject: | RE: How to get information from <input type=image ...> | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41171@lists.php.net to get a copy of this message | ||
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'; php-general@lists.php.net
> 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:zenith@linuxmail.org]
> > Sent: 21 February 2001 17:51
> > To: php-general@lists.php.net
> > 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??
> >
> >
> >
>