jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes window.open parent and Child Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window.open parent and Child" Watch "window.open parent and Child" New topic

window.open parent and Child

Ameya Thakur

Joined: Feb 12, 2004
Posts: 4
I have a smal problem in window.open()
I open a child window (pop up) through a button from my parent window.
Now i dont want to have acess to the Parent window until my child winodw is closed.ie i should not be able to work on the parent window.
Do you know any way in javascript in which we can achive this.
Its like this when we get an error message we arre not allowed to go the
parent window ....

i have a search form on the click of the button it will open an pop up
window which will perform the search now this window should be active alway
until and unless this is close it , only reason for which is the search form
is dynamic and it should not have the control over the parent window until &
unless the child winodw is close.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Welcome to JavaRanch "Kurt Cobain".
No doubt you clicked on something called the JavaRanch naming policy when you signed up. Could you please take a minute to change your display name to show a name, preferably your real name? Yes I know Kurt Cobain is a real name, but I highly doubt he is talking rfrom 6 feet under unless you are an Elvis. You can do that right here. It's all about maintaining our professional image - don't let the one-eyed moose fool you!
[ March 12, 2004: Message edited by: Eric Pascarello ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Basically you have three options....
Option 1 is to use a modal window...but that only works for IE
Option 2 is you need to put a setTimeout/setInterval code on the parent when the child is open. That timer will call a function and check to see if the child is open and check if the parent is in focus. If that is true you do window.blur() and ChildName.focus().
Option 3 which is the best. Use layers with an IFRAME, show the layer and cover the page with it, Person can not continue under the layer is hidden. This way you do not have to deal with pop up blockers and such and it will work in all modern day browsers unlike Option 1.
I agree. Here's the link: http://aspose.com/file-tools
subject: window.open parent and Child
It's not a secret anymore!