Ho fatto qualche prova:
Codice PHP:
<html>
<head>
<script type="text/javascript">
function coordinate(e){
stringaxy = "";
e = (e) ? e : event;
//if(!e) e = window.event
oggsrc = (e.target) ? e.target : e.srcElement;
sx = e.screenX
sy = e.screenY
cx = e.clientX
cy = e.clientY
ox = (e.offsetX) ? e.offsetX : e.layerX
oy = (e.offsetY) ? e.offsetY : e.layerY
stringaxy = "screenX = "+sx+", screenY = "+sy
stringaxy += " - clientX = "+cx+", clientY = "+cy
// stringaxy += "\n"+con_id(oggsrc).id+": X = "+ox+", Y = "+oy
stringaxy += " ID: X = "+ox+", Y = "+oy
document.forms["TEST"].coord.value = stringaxy
}
</script>
</head>
<body>
<form name="TEST" id="TEST" action="debug.asp" method="post" onclick="coordinate(event);">
<input type="text" id="coord" name="coord" value="" size="150"/>
<input type="text" id="campo" name="campo" value="" size="150"/>
<input type="submit" name="CONTINUA" value="Continua">
<input type="submit" name="SALVA" value="Salva">
</form>
</body>
</html>
perlomeno se si clicca in giro per la form nel primo campo si ottengono le coordinate:
Le prime (dovrebebro) essere quelle relative allo schermo
Le seconde all'area client
le terze relative all'ID su cui si clicca
può essere un punto di partenza ...
HTH
Zappa