PDA

View Full Version : Pls Help. Dropdown open in new window



Ozzyboy
Oct 1st, 2005, 10:16 PM
Howdy,

Can someone please help me. Im stuck..
When I select a combo box item, I need it to open to a new window.
I have seen many of these issues solved here, however this "may" be a little different. There is no "go" button. Appreciate any assistance given.

<HTML>
<HEAD>
<META name="GENERATOR" content="WYSIWYG Web Builder from http://www.pablosoftwaresolutions.com">
<TITLE>Background MOD</TITLE>
</HEAD>
<BODY bgcolor="#000000" text="#000000" vlink="#0000FF">
<DIV style="position:absolute;left:27px;top:240px;z-index:0" align="left" valign="top">
<FORM name="GoMenuForm0">
<SELECT name="GoMenu" onchange="OnGoMenuForm0Link()" language="JavaScript" style="width:171px">
<OPTION SELECTED VALUE> A32X Manuals</OPTION>
<OPTION value="file://03/cdrom3/A321%20SRM/start.pdf">A321 SRM</OPTION>
</SELECT>
</FORM>

<SCRIPT language="JavaScript">
function OnGoMenuForm0Link()
{
var url = document.GoMenuForm0.GoMenu.options[document.GoMenuForm0.GoMenu.selectedIndex].value +"";
if (url != '')
{
if(parent != self)
{
var doc = self;
while(doc != window.top)
{
doc = doc.parent;
}
if(url.indexOf("://")!=-1)
{
doc.body.window.location.href = url;
}
else
{
window.top.location.href = url;
}
}
else
{
window.top.location.href = url;
}
document.GoMenuForm0.GoMenu.selectedIndex=0;
}
}
</SCRIPT>
</DIV>
<IMG src="border.jpg" align="top" border="0" width="3753" height="125" style="position:absolute;left:0px;top:905px;z-index:1">
</BODY>
</HTML>

cyber11
Oct 2nd, 2005, 12:42 PM
Heres something much simpler.

-Bill


<html>
<head>
<title>Untitled Test</title>
<meta name="generator" content="BBEdit">
</head>

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

<option label="CNN" value="http://cnn.com" selected>CNN
<option label="GOOGLE" value="http://google.com">GOOGLE

</select>
&nbsp;<input type="button" value="Go to" onclick="window.open(this.form.urls[this.form.urls.selectedIndex].value,'_blank')">
</form>

</body>
</html>

Ozzyboy
Oct 2nd, 2005, 01:35 PM
Your help is greatly appreciated

Ozzyboy
Oct 2nd, 2005, 08:36 PM
Back again. I am trying to make an Active dekstop. When I use the above code, it opens the window and then closes it again..??? I am trying to link to a network PDF file. When I use the code as a web page no probs.. But as an active dekstop.. No good.