JavaScript just won't do.
The .NET way should be to handle the button click event on the PostBack and
get the screen coordinates of the button. Then add reasonable offsets to the
x,y point and use that as the position to set the popup position.
Having the calendar on a panel, we need to:
pnlCalendar.Sty le.Item("top") = iTop
pnlCalendar.Sty le.Item("left") = iLeft
where iTop and iLeft are the aforementioned screen coordinates (needing to
be appropriately computed ... which is the purpose of this posting).
"bruce barker" <no***********@ safeco.com> wrote in message
news:OR******** ******@tk2msftn gp13.phx.gbl...
the following client functions work in most browsers:
findPosY = function(obj){
var curtop = 0;
if (document.getEl ementById || document.all) {
while (obj.offsetPare nt) {
curtop += obj.offsetTop;
if (typeof(obj.scr ollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParen t;
}
}
else if (document.layer s)
curtop += obj.y;
return curtop;
}
findPosX = function(obj) {
var curleft = 0;
if (document.getEl ementById || document.all) {
while (obj.offsetPare nt) {
curleft += obj.offsetLeft
obj = obj.offsetParen t;
}
}
else if (document.layer s)
curleft += obj.x;
return curleft;
}
-- bruse (sqlwork.com)
"Dan Sikorsky" <ds****@gte.net > wrote in message
news:e$******** ******@TK2MSFTN GP15.phx.gbl...
| How do you get the x,y pixel location of a textbox so that you can
position
| the Web Date Control popup nearby the associated textbox that will
contain | the date selected by the Web Date Control?
|
| --
| Thank you kindly,
| Dan Sikorsky BAB, BScE, MSC
|
|