Click to See Complete Forum and Search --> : js modify


naturalmedia
11-04-2003, 06:05 AM
hi guy , we try to do a jump menu, the script follow

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

but we whant a link opened in a new window

<select name="sport" id="select2" onChange="MM_jumpMenu('self',this,0)">
we try to change in _blank or _parent . but not work some one now how to do this ????
tnk mate for your support

gil davis
11-04-2003, 06:36 AM
function MM_jumpMenu(targ,selObj,restore) {
if (targ == "_blank")
{window.open(selObj.options[selObj.selectedIndex].value);}
else
{eval(targ+".location='" + selObj.options[selObj.selectedIndex].value + "'");}
if (restore) selObj.selectedIndex = 0;
}

naturalmedia
11-05-2003, 04:09 AM
tnks mate now work ,
nice job pro!!!!!!