Click to See Complete Forum and Search --> : Can't get popup window left and top position dynamically


bubberz
01-08-2007, 12:18 PM
I'm trying to set the top and left properties of my popup calendar depening on which button I click, but can't get it to work with anything I try.

Here's what's in my function:

function PopupPicker(ctl, l, t)
{
var PopupWindow = null;
//settings='width'+ w + ', height='+ h ', location=no, directories=no, menubar=no, toolbar=no, status=no, scrollbars=no, resizable=no, dependant=no';
PopupWindow=window.open('DatePicker.aspx?Ctl=' + ctl, 'DatePicker', 'left='+l,top='+t');
PopupWindow.focus();
}

Here's my image code:
<img src="images/Calendar.gif" onclick="PopupPicker('StartDate', 250, 250);"

weegee101
01-08-2007, 12:21 PM
Looks like you've got a typo on:

PopupWindow=window.open('DatePicker.aspx?Ctl=' + ctl, 'DatePicker', 'left='+l,top='+t');

Try changing it to:

PopupWindow=window.open('DatePicker.aspx?Ctl=' + ctl, 'DatePicker', 'left='+l,'top='+t);

bubberz
01-08-2007, 12:27 PM
Hello!

I just changed the line and I get "Object Expected" errors.

bubberz
01-08-2007, 12:33 PM
This did it:
PopupWindow=window.open('DatePicker.aspx?Ctl=' + ctl, 'DatePicker', 'left='+l, 'top='+t);

...was missing a space after the comma b/n left and top

Thanks!