Solved

Setting focus to a window (Internet Explorer)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 63
How does Google get such fast response times? 5 152
Path to Python 9 107
Base1 Encode/Decode 3 68
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
A short article about problems I had with the new location API and permissions in Marshmallow
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

920 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

14 Experts available now in Live!

Get 1:1 Help Now