纤腰楚楚 阿诗玛:ASP高手,有谁能提供页面中下拉菜单的代码?我的一个页面只要做个下拉菜单就可以了

来源:百度文库 编辑:中科新闻网 时间:2024/04/26 07:57:50
一楼的,我想把1连接到已经有的2.asp网站,怎么连?

<form name="form1" method="post" action="">

<select name="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>

<form name="form1" method="post" action="">

<select name="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>

是你的意思吗

若想把1连接到已经有的2.asp页面就是跳转菜单。
做了2种你看看。
代码如下:
这是第一种,后面有前往的
<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;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
</head>

<body>
<form name="form1">
<select name="3" onChange="MM_jumpMenu('parent',this,0)">
<option value="1.asp">1</option>
<option value="2.asp">2</option>
<option value="3.asp">3</option>
</select>
<input type="button" name="Button1" value="前往" onClick="MM_jumpMenuGo('3','parent',0)">
</form>
</body>

这是另一种常用的:
代码如下:

<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>
<form name="form1">
<select name="3" onChange="MM_jumpMenu('parent',this,0)">
<option value="1.asp">1</option>
<option value="2.asp">2</option>
<option value="3.asp">3</option>
</select>
</form>

<form name="form1" method="post" action="2.asp">

<select name="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>

就这样了~!!