Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60792
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Popup focus
 
Similar Threads
login and password popup box
Focus on child window after parent window gets refreshed
Window.opener problem
Pop-Up Window and getParameter()
Check to see if "main page" is open or not from a pop-up?