Solved

disabling parent focus while child exists

Posted on 2001-07-16
4
275 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now