Forum Moderators: open
I am trying to use an image as a submit button. So my php/html code looks something like:
<? PHP code
if (isset ($submit))echo "true<br>";
else echo "false<br>";
?>
<form name="formX" method="post" action="" onSubmit="return check_form(this)">
<input name="submit" type="image" src="images-design/log-in.gif" alt="Log in button">
</form>
I was wondering if there were some important differences between Netscape and Internet Explorer in how they handle this tag? And if anyone knew how to get around this?
Also when i check if "submit" (name of image) is set after clicking the image i am getting false, when it should be true. Does anyone know why this maybe so?
Many thanks for your time
Alina
The value passed by an image input is an unusual one, in that it is the coordinates of where the mouse click occured that is sent through in the HTTP request. The W3C say [w3.org]:
When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively.
I've seen this before and we still used an image submit button but the server side code sniffed for the presence of "px" - that may work in your case also?
HTH