Click to See Complete Forum and Search --> : modify Dreamwvr jump menu to open in new window


Scooter
01-21-2003, 10:21 AM
I have a DW-inserted list box form on a non-frame page for which I want each link to open their URLs in a new window. But the default function behavior is to open them in same window. Can any kind soul inform me what edit I can make where to the following code to open each link in new window? I'm supposing the arg 'parent' needs replacing but I don't know DOM or JS worth diddly. MUCH thanks in advance!

~Scooter
=============================

Function declared in HEAD script:


<SCRIPT language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>

Then function called from form:

<FORM name="form1">
<SELECT name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<OPTION selected>-- select --</OPTION>
<OPTION value="http://google.com">Google</OPTION>
etc...

Dan Drillich
01-21-2003, 11:46 AM
Please try -


<SCRIPT language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
var s = selObj.options[selObj.selectedIndex].value;
window.open(s);
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>

Then function called from form:

<FORM name="form1">
<SELECT name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<OPTION selected>-- select --</OPTION>
<OPTION value="http://google.com">Google</OPTION>
</SELECT>
</FORM>



Cheers,
Dan

Scooter
01-21-2003, 01:05 PM
Sweet! :D

Thanks so much, Dan - your solving that riddle that's plagued me thru the weekend just made my day, if not week.

aunt_Lois
02-14-2003, 11:20 AM
Thanks to both of you -- Scooter for asking -- Dan for answering -- You both saved me a lot of time and trouble!