/    Sign up×
Community /Pin to ProfileBookmark

Pull Down menu Options need to open in New Window

We have a pulldown menu that lists other websites for users reference. I’d like the items on the list to open in a new window and not replace the site. Here are two sections of the code. I’ve tried numerous things and nothing is working. Any ideas?

function selectHOME()
{
//use this function to process Site navigation

choice=document.Home.IndexItem.selectedIndex;
if (choice==1)
{
top.location.href=”http://address.htm“;
}

Then further down the selections are:

<form name=”Home”><td align=”left”><font size=”-3″ face=”tahoma”>
<select name=”IndexItem” onchange=”selectHOME();document.location.reload();” style=”font: 7pt Tahoma; background: ffffff”>
<option value=”” selected>Websites
<option>Site One

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@requestcodeAug 28.2003 — Here is an example of one way you can do it:

<html>

<head>


<title>Drop Down Test</title>

<script language="javascript">

function LinkUp(obj)

{

linkid=obj.options[obj.selectedIndex].value

NewWin=window.open(linkid,"win1",config="width=200,height=250,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=30,left=30")

}

</script>

</head>

<body bgcolor="lightgreen">

<form name="DropDown">

<select name="DDlinks" onchange="LinkUp(this)">

<option selected>Choose a Link

<option value="http://www.htmlgoodies.com"> HTML Goodies</option>

<option value="http://www.wsabstract.com"> Website Abstraction</option>

<option value="http://www.requestcode.com"> Request Code</option>

</select>

</form>

</body>

</html>
×

Success!

Help @fitzi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...