Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window.open parent and Child

 
Ameya Thakur
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
Eric
[ March 12, 2004: Message edited by: Eric Pascarello ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic