Solved

Setting focus to a window (Internet Explorer)

Posted on 2003-11-27
2
467 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
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?

808 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