PDA

View Full Version : Links in Drop down forms


j-man
10-30-2002, 04:15 PM
Ok...I have a drop down jump menu links in it. The question is, How do I get the selections to target a new window instead of targeting to same window?

PauletteB
10-30-2002, 04:30 PM
Please...
Post the code

j-man
10-30-2002, 04:38 PM
ok...here the script....

<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>

then my form code reads....


<form name="testform">
<select name="jumplinks" onChange="MM_jumpMenu('parent',this,0)">
<option value="http://www.yahoo.com" selected>Demo</option>
</select>
//
//
</form>
:D

does this help?:confused:

Roy Sinclair
10-30-2002, 09:24 PM
<select name="jumplinks" onChange="MM_jumpMenu('newwindow',this,0)">

j-man
10-30-2002, 09:49 PM
ok..... the 'newwindow' deal doesn't seam to work either.....

Is there another way??;)

PauletteB
10-30-2002, 10:03 PM
An alternative way (there are plenty) which allows you to control the window parameters:

<html>
<head></head>
<body>
<form>
<select onChange="window.open(options[selectedIndex].value,
'newwin', 'menubar=yes,scrollbars=yes,left=100,top=50,width=500,height=400')">
<option value="javascript:window.close()">Select...</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.msn.com">MSN</option>
</select>
</form>
</body>
</html>

The forum tends to add spaces between window and open.

j-man
10-30-2002, 10:10 PM
Whooo Hoooo!

That last post helped me !!

Thanks to everyone for their help!!:p