Solved

Setting focus to a window (Internet Explorer)

Posted on 2003-11-27
2
476 Views
Last Modified: 2010-04-17
Hi everyone,

I have a drop down box where when you pick a news release, the news release pops up in a new window. The select tag is here:

<select name="News" size="1" onchange="window.open(this.value,'News', 'location=no, toolbar=no, menubar=no, status=no, scrollbars=yes, resizable=yes')">

Here's what's not working. Say you pick a news release, the window pops up fine. But say you leave the pop up window open, and you pick another news release, the second news release shows up in the pop up window fine, except the pop up window is behind the window with the drop down box. Is there a way to make the pop up window come in the front when the second news release is chosen?

Thanks in advance.
0
Comment
Question by:filemanager
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
aschroeder1 earned 50 total points
ID: 9851077
You can focus on the calling page or the popup page.
On the page with the select box, you could use:
<select name="News" size="1" onchange="window.open(this.value,'myNews', 'location=no, toolbar=no, menubar=no, status=no, scrollbars=yes, resizable=yes')">

<script language="javascript">
var myNews;
if(myNews)
      myNews.focus();
</script>
or
On the popup page, just put
<body onLoad="window.focus();">
or
<body onBlur="window.focus();">
they work differently so see how you want it to work.
0
 

Author Comment

by:filemanager
ID: 9859336
Oh ok thanks. I tried "window.setfocus();" but it didn't work :P Anyway window.focus() works great! :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question