Solved

disabling parent focus while child exists

Posted on 2001-07-16
4
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

696 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