File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Popup focus

Curtis Lokszyn

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?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
var win =;

Curtis Lokszyn

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

Joined: Jan 10, 2002
Posts: 63839

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Popup focus
It's not a secret anymore!