Solved

disabling parent focus while child exists

Posted on 2001-07-16
4
278 Views
Last Modified: 2012-06-27
Hi
Im trying to take some input from a child window, but
at the same time i dont want the user to see the parent window (so that he doesnt messes up), so is there some way i can 'disable' the parent while the child window exists ???

0
Comment
Question by:dosdemon
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
OmegaJunior earned 100 total points
ID: 6285664
Greetings, dosdemon,

Have you tried this approach?

In the main window, have a function like this:

/* global variable: lives while the page lives. */
var winMyChild;

function CreateChildWindow() {
 /* Create a new browser window.
 Put the result of the window into the global variable. */
 winMyChild = window.open("url", "name", options);
 /* Give the new browser window the focus. */
 winMyChild.focus();
 return true;
}

Then, when the main window receives focus, you can have an expression like this:

function CheckChild() {
 /* If the global variable still is a window with the name I assigned to it... */
 if (winMyChild.name=="name"){
  /* ...then give it the focus instead of the main window. */
  winMyChild.focus();
 }
 return true;
}

For this CheckChild function to start, the <body> element needs the event handler "onFocus" like this:

<body onFocus="CheckChild();">

Imagine!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7910371
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7999749
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to OmegaJunior

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 

Expert Comment

by:SpideyMod
ID: 8067996
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question