PDA

View Full Version : Position of input field in javascript



DBers
July 26th, 2005, 22:46
I created a dynamic calendar that lets visitors select the date. right now its is activated when a user clicks on a link. I want it so that when the form field gets focus it will popup.

I know the onfocus parts; the problem is the (x,y) position wher the calender needs to pop up. The only way i can get the position is somethnig like this:
document.all[dateField].style.left;
dataField holds the string name of the field inwhich activates the calendar.
unfortuantly this only works when i predefine the left (x,y) postion to begin with; which doesn not suit my needs.

Does anyone know of another way to get the position? or a way to make the calender's postion to be write under the form field?

Dan