ASM wrote:
yes you can with onmousemove
http://stephane.moriaux.perso.orange...uc/coord_carte
beforeSubmit() will only have to know the last y and x
gotten by the onmousemove
Thanks for answer.
It is good example but it is not exactly the same I am looking for.
I have considered this approach before and I found that it not so
simple. Value of layerX(layerY) depends on an image position on the
page and not always returns coordinates relative to the image.
For example, try this in Firefox.
<div style="text-align:center">
<input type=image name="Image1" onclick="beforeSubmit(event);"
src="..."/>
</div>
function beforeSubmit(e)
{
xpos = e.layerX? e.layerX : e.offsetX? e.offsetX : 0;
ypos = e.layerY? e.layerY : e.offsetY? e.offsetY : 0;
alert(xpos + ", " + ypos);
}
But that is not the case. It can be corrected with more complicated
script.
I am interested whether it is possible to retrive values that are
automatically submitted to the server when I click on <input
type="image"element placed inside a form? This values can be
retrieved on the server side but I can find how to get them on client
side (by means of javascript). Is it possible?
Regards, Mykola