Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focus on MAIN window without minimizing the POP UP window.

Status
Not open for further replies.

rcsen

Programmer
Jan 11, 2001
51
US
Hi
I have a MAIN window which has a TEXT BOX and A BUTTON

On clicking the BUTTON, a POP-UP WINDOW opens which contains
a lookup table.

Now my requirement is,

THE POP-UP window should STAY on the TOP of the MAIN window BUT the FOCUS should be in MAIN window and I should be able to enter text in textbox.

Could you please help me?

Thanks in advance

-RCSEN



 
Umm -- you can't do that --

If I understand you correctly, then you want the popup to stay on top (thereby having focus) and enter information on the parent window (thereby giving it focus) ??

Sorry, whatever window you are entering information into is going to be on top -- :-(
 
Hi,

I just want to enter information in the parent window by seeing the values in the popup window.
Is there anyway to do that??

Thanks.
-RCSEN.
 
I really don't think so -- I hate to say that, but I fear it's the truth.

I suppose an alternative could be to size the parent window so that the popup could fit over to the side -- or maybe use frames and open the popup content in another frame, possibly??

I hope someone else can help out more. :-(
 
Did you try the following in the popup's HTML?

Code:
<body blah blah onBlur=&quot;self.focus()&quot;>

Good luck hunting...
 
This seems like a stretch, especially efficiency wise, but couldn't you use a keypress event on the popup window that forwarded the presses to the parent window?

Just a thought.

brendanc@icehouse.net
 
Actually, I thought of using key press event but my UI team wants me to do this way.(Like, seeing in the POPUP and entering the values in the parent window)


Yap. I tried the
<body blah blah onBlur=&quot;self.focus()&quot;>

Thanks for your help.
Please let me know if there is ??????

-RCSEN



 
You can fire more than one action with the keypress event. Just map the event to a function that displays the character in your popup then puts the character on the page beneath.

:shrug:

brendanc@icehouse.net
 
While I go away & digest the contents above any suggestions I couldn't deduce from above on how to remove a pop-up put there by a very helpful ISP?

It appears by virtue of the domain hosting, the target web pages are in a clean webspace. The banner ad is removed with a parent.location.href script command but how do I return focus to the window with the script and thereby hope the pop-up will self cancel like it does with mouse clicks on the main window? I don't have the pop-up name and suspect it will change for each pass. Once removed it can not return because the called pages are then in clean space.

timer instructions in javascript should not be difficult but a focus command seems to elude me. Am I being dumb?
 
Cresby,

unfortunately I don't think you can access a new window without using a name. have you looked at the source code to see if/what they name it? =========================================================
if (!succeed) try();
-jeff
 
jemminger Thanks for prompt response.

the problem is that my window is accompnied by the popup which self cancels when you click my window. All I need is to regain focus to achieve a minimum result. I will try geting their code but I suspect the are probably doing a couple of things.

Anyone looking at my code will not see what I did to remove the banner ad - it uses parent.location.href which if successful is not seen on the secondary page that results. If they are making life difficult for me (& I assume that is much to their advantage) their code will not give all the story. like dynamically altering names etc
 
The offending pop-up window has only the icon to allow saving to get the HTML. The only significant code that is

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onLoad=&quot;window.focus(); setTimeout('window.close()','6000')&quot; link=&quot;#000000&quot; vlink=&quot;#000000&quot; alink=&quot;#000000&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>

The rest is normal links and images. The lack of evidence on how the pop-up self-cancels on losing focus is my clue it has been executed in overwritten code. Much as I do to remove the banner ad.

maybe the window.focus is a clue to what I might be able to try.

Cresby
 
looks to me like it's closing itself after 6 seconds using setTimeout('window.close()','6000') - there's no code related to onblur in there.
=========================================================
if (!succeed) try();
-jeff
 
I thought that was 6000 seconds. It does not self cancel until it loses focus unless I am so impatient I beat it to it. I only go to my own website to check on sillies and because it bumps the hits. It is easier to combine all that and get the link to my other forum in the lazy way.

I will go try. Thanks but I am still investigating.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top