need to open options url into a new window

B

bwarhold

i need to have these links open into a new window and can't figure out
how.

any help would be greatly appreciated.

Thanks,

b


here's the following code:

<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>

<FORM
ACTION="../cgi-bin/redirect.pl"
METHOD=POST onSubmit="return dropdown(this.gourl)">
<SELECT NAME="gourl">
<OPTION VALUE="">LHD Emergency Response Folder...
<OPTION VALUE="http://google.com">Google
<OPTION VALUE="http://yahoo.com">Yahoo



</SELECT>

<INPUT TYPE=SUBMIT VALUE="Go">
</FORM>
 
A

ASM

(e-mail address removed) a écrit :
i need to have these links open into a new window and can't figure out
how.

any help would be greatly appreciated.

Thanks,

b


here's the following code:

<SCRIPT TYPE="text/javascript">
<!--

/***
* To load in main window (not in frames)
***/
function dropdown(mySel)
{
var myIndex = mySel.selectedIndex;
if(myIndex==0) alert('choice in the list');
else
top.location = mySel.options[myIndex].value;
return false; // too late ! a new page was called !
}

/***
* to load in a "new" window
* you have to open this "new" window
***/

var truc = false;

function dropdown(mySel)
{
var myIndex = mySel.selectedIndex;
if(myIndex==0) alert('choice in the list');
else {
if(truc && !truc.closed)
{
truc = window.open();
}
truc.location = mySel.options[myIndex].value;
truc.focus();
}
return false;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top