Solved

disabling parent focus while child exists

Posted on 2001-07-16
4
277 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

773 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