473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Keeping pop-up on top of parent window

Hello all,
I am new to Javascript and have been trying to find an answer to this
problem. After searching 3 books and searching postings, I am going to ask
this newgroup.

I am using a pre-built javascript DatePicker. It uses window.open to display
the Calendar and works fine if the user clicks on a link for a specific
date. The proper textbox in the parent window form is populated and the
DatePicker closes.

The problem is when a user clicks on the parent window, the datepicker is
hidden behind the parent window. Beleieve it or not, this creates a real
problem for many users.

Is there any way to put up an alert to the user and then set focus back to
the datepicker if the user clicks on the parent window by mistake?

In the datepicker.js there is a reference to the window created:

ggwindow = window.open(..parameters)

So I tried something like ggwindow.onblur=dont_close_me() referring to a
function that displays an Alert and then sets focus back to the datepicker
window. I know that onblur is an event and not a property or method of the
Window object, but I have also seen mentioned that the onblur event can be
applied to the Window object.

During window creation I don't see a way to set the onblur event for the
created window.

This is probably an easy question for an experienced javascript programmer,
so I am asking.

Thanks for your replies...


Mar 22 '07 #1
4 7832
On Mar 22, 4:01 pm, "John Kotuby" <j...@powerlist.comwrote:
Hello all,
I am new to Javascript and have been trying to find an answer to this
problem. After searching 3 books and searching postings, I am going to ask
this newgroup.

I am using a pre-built javascript DatePicker. It uses window.open to display
the Calendar and works fine if the user clicks on a link for a specific
date. The proper textbox in the parent window form is populated and the
DatePicker closes.

The problem is when a user clicks on the parent window, the datepicker is
hidden behind the parent window. Beleieve it or not, this creates a real
problem for many users.

Is there any way to put up an alert to the user and then set focus back to
the datepicker if the user clicks on the parent window by mistake?

In the datepicker.js there is a reference to the window created:

ggwindow = window.open(..parameters)

So I tried something like ggwindow.onblur=dont_close_me() referring to a
function that displays an Alert and then sets focus back to the datepicker
window. I know that onblur is an event and not a property or method of the
Window object, but I have also seen mentioned that the onblur event can be
applied to the Window object.

During window creation I don't see a way to set the onblur event for the
created window.

This is probably an easy question for an experienced javascript programmer,
so I am asking.

Thanks for your replies...
I found this in another post:
The only way I know to do that is to include
<BODY ONBLUR="top.focus();">
in the BODY tag of the pop-up window.

Mar 22 '07 #2
I am using a pre-built javascript DatePicker. It uses window.open to display
the Calendar and works fine if the user clicks on a link for a specific
date. The proper textbox in the parent window form is populated and the
DatePicker closes.
....
The problem is when a user clicks on the parent window, the datepicker is
hidden behind the parent window. Beleieve it or not, this creates a real
problem for many users.

Is there any way to put up an alert to the user and then set focus back to
the datepicker if the user clicks on the parent window by mistake?...
I found this in another post:
The only way I know to do that is to include
<BODY ONBLUR="top.focus();">
in the BODY tag of the pop-up window.
I hate to chase you away from Javascript, but it would be much better to
do it using a DIV that floats over the page, like say:
http://www.meanfreepath.com/javascri...dar/index.html
Mar 22 '07 #3
Thanks for the help Steve...

"Steve" <St***@srpatterson.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On Mar 22, 4:01 pm, "John Kotuby" <j...@powerlist.comwrote:
>Hello all,
I am new to Javascript and have been trying to find an answer to this
problem. After searching 3 books and searching postings, I am going to
ask
this newgroup.

I am using a pre-built javascript DatePicker. It uses window.open to
display
the Calendar and works fine if the user clicks on a link for a specific
date. The proper textbox in the parent window form is populated and the
DatePicker closes.

The problem is when a user clicks on the parent window, the datepicker is
hidden behind the parent window. Beleieve it or not, this creates a real
problem for many users.

Is there any way to put up an alert to the user and then set focus back
to
the datepicker if the user clicks on the parent window by mistake?

In the datepicker.js there is a reference to the window created:

ggwindow = window.open(..parameters)

So I tried something like ggwindow.onblur=dont_close_me() referring to a
function that displays an Alert and then sets focus back to the
datepicker
window. I know that onblur is an event and not a property or method of
the
Window object, but I have also seen mentioned that the onblur event can
be
applied to the Window object.

During window creation I don't see a way to set the onblur event for the
created window.

This is probably an easy question for an experienced javascript
programmer,
so I am asking.

Thanks for your replies...

I found this in another post:
The only way I know to do that is to include
<BODY ONBLUR="top.focus();">
in the BODY tag of the pop-up window.

Mar 22 '07 #4
Thanks Gary,

Looks like a great product,

I was also considering using the ASP.NET 2.0 Calendar control with CSS
absolute positioning and invisibility along with asynchronous callback to
the Server, but that seemed like much more work just to get this one problem
fixed.

I will test out the DIV control....

"Gary Hasler" <ga********@thelogconnection.comwrote in message
news:46***************@thelogconnection.com...
I am using a pre-built javascript DatePicker. It uses window.open to
display
the Calendar and works fine if the user clicks on a link for a specific
date. The proper textbox in the parent window form is populated and the
DatePicker closes.
...
The problem is when a user clicks on the parent window, the datepicker
is
hidden behind the parent window. Beleieve it or not, this creates a
real
problem for many users.

Is there any way to put up an alert to the user and then set focus back
to
the datepicker if the user clicks on the parent window by mistake?...

>I found this in another post:
The only way I know to do that is to include
<BODY ONBLUR="top.focus();">
in the BODY tag of the pop-up window.

I hate to chase you away from Javascript, but it would be much better to
do it using a DIV that floats over the page, like say:
http://www.meanfreepath.com/javascri...dar/index.html

Mar 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure,...
4
by: Andre | last post by:
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST =...
1
by: spencer | last post by:
Hi, The code. def buildStackMajor(): for node in dirStackMinor: #print 's is the node...', node dirStackMajor.append(node) dirStackMinor.pop() print 'POP the stack...', len(dirStackMinor)...
6
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the...
6
by: Michael Bulatovich | last post by:
I have a very simple db I use for keeping track of hours, tasks, projects, clients etc. It has a form that I use to enter data. Currently the form has a textbox for a field called "start time",...
15
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: ...
25
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a...
7
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element...
4
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent...
4
by: Marina Levit | last post by:
I am trying to do some processing on a background thread while keeping the UI painting. However, this is a generic server side call routine - and it needs to block until the server side call...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.