R
ruca
Hi,
DESCRIPTION:
I'm developing an application that when I need to insert a date, I use 3
textbox's and one image button. This image button open's a small popup
window with a calendar, allowing user choose date. Then, this popup returns
the year, month and day to the correspondent textbox. So far, so good.
PROBLEM:
The problem is that the applications opens so popup's as the number of
clicks that I do in image button. What I want is that only opens one popup
at a time. That when it's already one open, this closes and open a new
popup.
For that I have a .JS file that have this:
-------------------------------------------------
var NewWnd = null;
function DestroyWnd()
{
// close the current window
if(this.NewWnd != null)
{
this.NewWnd.close();
this.NewWnd = null;
}
}
function pick(Year,Month,Day)
{
if((this.NewWnd == null) || (this.NewWnd.closed))
{
var url = "Calendar.aspx?srcA=" + Year + "&srcM=" + Month + "&srcD=" + Day
this.NewWnd = window.open(url, "_blank", "height=200, width=200, left=250,
top=200, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true);
}
else
{
DestroyWnd();
pick(Year,Month,Day);
}
}
DESCRIPTION:
I'm developing an application that when I need to insert a date, I use 3
textbox's and one image button. This image button open's a small popup
window with a calendar, allowing user choose date. Then, this popup returns
the year, month and day to the correspondent textbox. So far, so good.
PROBLEM:
The problem is that the applications opens so popup's as the number of
clicks that I do in image button. What I want is that only opens one popup
at a time. That when it's already one open, this closes and open a new
popup.
For that I have a .JS file that have this:
-------------------------------------------------
var NewWnd = null;
function DestroyWnd()
{
// close the current window
if(this.NewWnd != null)
{
this.NewWnd.close();
this.NewWnd = null;
}
}
function pick(Year,Month,Day)
{
if((this.NewWnd == null) || (this.NewWnd.closed))
{
var url = "Calendar.aspx?srcA=" + Year + "&srcM=" + Month + "&srcD=" + Day
this.NewWnd = window.open(url, "_blank", "height=200, width=200, left=250,
top=200, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true);
}
else
{
DestroyWnd();
pick(Year,Month,Day);
}
}