怎样把联动菜单里的值传到另一个页面?
<select name="Nclassid">
<%rs.open "select * from stype where btype_id="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option selected value="<%=rs("stype_id")%>"><%=rs("stype_name")%></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=rs("stype_name")%>"><%=rs("stype_name")%></option>
<% rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>
我想把这个2级菜单的值传到另一个页面 怎么办?
问题点数:30、回复次数:5Top
1 楼daxuejianku(无言的悲伤)回复于 2006-09-01 08:53:40 得分 0
如果你单单是想得到2级菜单选中的值。只需要提交表单就可以了。在下个页面用request.form("菜单名")如果想得到所有值。你可以通过隐藏<input type="hidden" name="caidan1">
<option selected value="<%=rs("stype_id")%>"><%=rs("stype_name")%
<input type="hidden" name="caidan1" value="<%=rs("stype_id")%>">
提交表单在下一个页面用request.form("caidan1")就会得到菜单1的所有值。。。再用split函数分开他们。
Top
2 楼guanlei(不懂就问)回复于 2006-09-01 09:13:13 得分 0
我只想2级菜单里的值 但是我用表提提交的方法取不到值
chexing=request.Form("Nclassid")Top
3 楼daxuejianku(无言的悲伤)回复于 2006-09-01 09:56:18 得分 0
那你要检查一下。。看它是在表单里么。提交没有。Top
4 楼ck1983()回复于 2006-09-01 16:46:18 得分 0
同意daxuejianku(小牛试刀)
你要仔细检查自己代码.Top
5 楼zzjlxla()回复于 2006-09-01 16:56:41 得分 0
我在这里发给你个六级联动的下拉框,如果还想加,还可以加,大家看看:
<!--#include include file="conn.asp"-->
<%
dim count
for ss=0 to 4
select case ss
case 0
tablename="shi"
case 1
tablename="xuexiao"
case 2
tablename="nianji"
case 3
tablename="banji"
case 4
tablename="xueshen"
end select
sql="select * from "&tablename&" order by id desc"
set rs=server.createobject("adodb.recordset")
'sql = "select * from shi order by id desc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount<%=ss%>;
subcat<%=ss%> = new Array();
<%
count = 0
do while not rs.eof
%>
subcat<%=ss%>[<%=count%>] = new Array("<%= trim(rs("id"))%>","<%= trim(rs("upid"))%>","<%= trim(rs("name"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount<%=ss%>=<%=count%>;
</script>
<% next%>
<script language = "JavaScript">
function changelocation(locationid,Xname,num)
{
document.getElementsByName(Xname)[0].length=1;
var subcat = new Array();
var locationid=locationid;
subcat = window["subcat"+num];
onecount = window["onecount"+num] //<-- this line
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.getElementsByName(Xname)[0].options[document.getElementsByName(Xname)[0].length] = new Option(subcat[i][2], subcat[i][0]);
}
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 2</title>
</head>
<body>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="ArticleSave.asp?action=add" target="_self">
<%
sql = "select * from sheng"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
else
%>
<select name="select0" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value,'select1',0)" size="1">
<option selected value="<%=trim(rs("id"))%>"><%=trim(rs("sheng"))%></option>
<%
dim selclass
selclass=rs("id")
rs.movenext
do while not rs.eof
%>
<option value="<%=trim(rs("id"))%>"><%=trim(rs("sheng"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<select name="select1" onChange="changelocation(document.myform.ShiName.options[document.myform.ShiName.selectedIndex].value,'select2',1)" size="1">
<option value="" selected>不指定小类</option>
</select>
<select name="select2" onChange="changelocation(document.myform.XueXiaoName.options[document.myform.XueXiaoName.selectedIndex].value,'select3',2)" size="1">
<option value="" selected>不指定小类</option>
</select>
<select name="select3" onChange="changelocation(document.myform.NianJi.options[document.myform.NianJi.selectedIndex].value,'select4',3)" size="1">
<option value="" selected>不指定小类</option>
</select>
<select name="select4" onChange="changelocation(document.myform.BanJi.options[document.myform.BanJi.selectedIndex].value,'select5',4)" size="1">
<option value="" selected>不指定小类</option>
</select>
<select name="select5">
<option value="" selected>不指定小类</option>
</select>
</form>
</body>
</html>
Top




