GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes Popup focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Popup focus" Watch "Popup focus" New topic
Author

Popup focus

Curtis Lokszyn
Greenhorn

Joined: Apr 23, 2008
Posts: 4
Ok, I have a button in the main site and when it is clicked a pop up window opens and the user can navigate and do whatever. Then they can go back to the main site and click another button which is supposed to then give focus to the pop up window again (just a different part).

Here's the thing: It works just fine in Safari. Whenever a button is clicked the focus goes back to the popup window, yet every other browser seems to keep the popup window behind.

Any idea of how to FORCE the popup window to have focus?

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
var win = window.open(...);
win.focus();


Eric
Curtis Lokszyn
Greenhorn

Joined: Apr 23, 2008
Posts: 4
Thanks. How do you apply it to a form button?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Have the onload code in the page force focus to the button.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: Popup focus