Solved

Setting focus to a window (Internet Explorer)

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now