I have a drop down menu, and when the user clicks ‘go’, it jumps to the corresponding page (code below). Does anyone know how I can get this to open in a new window? (This should be pretty simple – but I’m terrible at JS)… Thanks a lot for any help.
[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>
[code=html]<form action=”../cgi-bin/redirect.pl” method=”post” onsubmit=”return dropdown(this.gourl)”>
<select name=”gourl”>
<option selected>choose a destination…
<option value=”http://www.htmlgoodies.com”>guide to html
<option value=”http://www.foremostgroups.com”>my home page
<option value=”http://www.ninthwonder.com”>ninth wonder
</select>
<input type=submit value=”go”>
</form>
and is this necessary (I obviously got this code from a website that provides scripts)… action=”../cgi-bin/redirect.pl”… i don’t even have that perl file, so this is useless, right?