Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Popup focus

 
Curtis Lokszyn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
var win = window.open(...);
win.focus();


Eric
 
Curtis Lokszyn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. How do you apply it to a form button?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have the onload code in the page force focus to the button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic