SirWilliam wrote:
Thanks Jonas.
I had a look the at URL mentioned, pretty close to what we needed but
didn't realy shed any light on why our script didn't work when using a
form.
Ok
<input name="T2" value="Text2 (2,2)" x="2" y="2" type="text"> onfocus="setXY()">
Instead of setting this manually, you can make it automatic, by keeping
track of all the inputs offsets, then you just need to check who's the
nearest from the current input offset or create your grid dinamically
(if your page layout doesn't change while filling the fields, that would
be the best solution) ;]
getOffset = function(o){
for(var r = {x: o.offsetLeft, y: o.offsetTop, h: o.offsetHeight, w:
o.offsetWidth};
o = o.offsetParent; r.x += o.offsetLeft, r.y += o.offsetTop);
return r;
}
--
Now with alcohol <URL:http://youtube.com/watch?v=lnQTZxqxc10> =X
Jonas Raoni Soares Silva
http://www.jsfromhell.com