onchange="window.open...... not working!

Here is my <select> tag:

<select name="News" size="1" onchange="window.open(this.options[this.selectedIndex].value,'News')">

all the option tags (except the first one, which says "Please select a news release..." and has no value) have the page links in the value. ie: <option value="link1.htm">

Before, the news page was in frames, and this same code used to work (except instead of window.open, it was news_frame(this.options... blah blah).

I've tried everything and nothing seems to work!

Thanks in advance! :)
filemanagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BustaroomsCommented:
it looks ok to me

think we'll need more code or a url to be able to help
0
NetGrooveCommented:
First of all, you can reduce it to this:

<select name="News" size="1" onchange="window.open(this.value,'News')">


Second, your statement "nothing seems to work!" does not describe the error you are getting at all.
Say first what result you are trying to achieve, and then what errors do you get.

0
filemanagerAuthor Commented:
Well, I want the value in the option tag (the HTML page) to pop up in a new window, but the code I pasted above, it doesn't do anything for some reason.

The drop down box is slightly long, so I'll only put in the first couple option tags:

<select name="News" size="1" onchange="window.open(this.value,'Enghouse News')">
<option>Please select a news release...</option>
<option value="c_Q32003.htm">Enghouse Q3 Net Income up over 150% - Sept. 10, 2003</option>
<option value="c_Q22003.htm">Enghouse Q2 Revenue and Net Income up over 50% - June 5, 2003</option>
....
</select>

So if you click on any of the news headings, it's supposed to pop up that article in a new window, but no new window appears.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

filemanagerAuthor Commented:
Oh, and here's the <form> tag (in case it helps):

<form method="POST" align="left" name="News_Select" action="" target="_blank">
0
BustaroomsCommented:
not to be a jacka$$ but you're not running any popup blockers are you?
0
James RodgersWeb Applications DeveloperCommented:
i tested your code with local files on win2k with ie 6 and it worked fine
0
filemanagerAuthor Commented:
Not running any popup blockers, no :P
0
BustaroomsCommented:
it has to be another part of your code or something.  do you have a url where we can see this
0
ren_bCommented:
try using a full uri?..
<select onchange="return window.open('http://domain/dir/'+this.value,'blahblah');">
0
devicCommented:
try instead:
Enghouse News
this:
EnghouseNews

;)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
devicCommented:
here is with space :)
=========================
<select name="News" size="1" onchange="mywin=window.open(this.value);mywin.document.title='Enghouse News'">
<option>Please select a news release...</option>
<option value="c_Q32003.htm">Enghouse Q3 Net Income up over 150% - Sept. 10, 2003</option>
<option value="c_Q22003.htm">Enghouse Q2 Revenue and Net Income up over 50% - June 5, 2003</option>
....
</select>
0
ren_bCommented:
you still have to use a full uri...
you cannot open your browser and type "c_Q32003.htm" and expect it to know where to go can you? no.

if the values on the options were something like "http://blah.com/c_Q32003.htm" then it would work fine.

you could do as ive said earlier, or do that in a function for window.open:

function openWin(lc,nm)
{
  var path = "http://www.experts-exchange.com/" //should be whats relevant to you
  return window.open(path+lc,escape(nm));          //escape(nm) clears up the spaces if there are any:
                                                                         //    Enghouse News > Enghouse%20News
}
0
ren_bCommented:
here would be a small application:

<html>
<head>
<script type="text/javascript">
<!--
function openWin(lc,nm)
{
  if(lc==0) return false;
  else
  {
    var path = "http://www.experts-exchange.com/
    window.open(path+lc,escape(nm));        
  }
}
//-->
</script>
</head>
<body>
<form>
<select onchange="openWin(this.value,'Enghouse News');">
<option value=0>Please Select a Site</option>
<option value="Web/">Web</option>
<option value="Web/Web_Languages/">Web Languages</option>
<option value="Web/Web_Languages/Javascript/">Javascript</option>
<option value="Web/Web_Languages/PHP/">PHP</option>
<option value="Web/Web_Languages/CSS/">CSS</option>
</select>
</form>
</body>
</html>
0
devicCommented:
@ ren_b,
it would be nice, if you check your script, before post it.
0
incongruentCommented:
the url should still work with a relative path.  It has when I've used it.

0
ren_bCommented:
the script works fine, ie just doesn't handle it right: it won't allow % in the name whereas mozilla does which i tested it on, sorry. if the name were just EnghouseNews itd be fine. i don't know what the problem could be... it has to be something esle than what he's given us.
0
devicCommented:
yea, Mozilla is good, but 96% is IE, and MUST in IE work ;)
0
vknowlesCommented:
It looks like the problem is the use of the Name attribute to try to establish the window title.

From what I recall, the Name attribute is rather vaguely defined in the standards and different browsers can treat it in different ways.  Using the second parameter in the window.open method is risky.

I like devic's method of setting the window title explicitly after you open it.

-Van
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.