Solved

Setting focus to a window (Internet Explorer)

Posted on 2003-11-27
2
483 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Part One of the two-part Q&A series with MalwareTech.
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…
Simple Linear Regression

630 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