Solved

disabling parent focus while child exists

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
links not working 2 27
testing a web application for ipad on windows pc 3 38
what should i learn? javascript or typescript? 3 38
Slush on text 2 11
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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

733 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