我原本的页面上已经有一组连动菜单了,现在我需要再增加一组连动菜单,请问我要怎么实现啊。一下是原来已经有的连动菜单代码:
<%
dim rs2
dim sql
dim count
set rs2=server.createobject("adodb.recordset")
sql = "select * from softclass where classid>0"
rs2.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs2.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs2("class"))%>","<%= trim(rs2("classid"))%>","<%= trim(rs2("id"))%>");
<%
count = count + 1
rs2.movenext
loop
rs2.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.id.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.id.options[document.myform.id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<script language=javascript>
function check()
{
if(document.myform.id.value=="")
{
alert("小类未选择");
return false;
}
if(document.myform.pttid.value=="")
{
alert("平台未选择");
return false;
}
if(document.myform.softname.value=="")
{
alert("软件名称为空");
return false;
}
if(document.myform.txtcontent.value=="")
{
alert("软件说明为空");
return false;
}
if(document.myform.softlink.value=="")
{
alert("软件链接为空");
return false;
}
if(document.myform.jixing.value=="")
{
alert("适用机型为空");
return false;
}
if(document.myform.writer.value=="")
{
alert("添加人为空");
return false;
}
}
</script>
</head>
<body>
<br><form method="POST" name="myform" action="softsave.asp?action=add" onsubmit="javascript:return check();">
<table align="center" width="95%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<tr>
<td colspan="2" class=lanyuss>添 加 软 件</td>
</tr>
<tr class=lanyuds>
<td align=right>软件类别:</td>
<td>
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from softclass where classid=0"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先<a href=addsoftclass.asp>添加栏目</a>"
response.end
else
%>
<select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1">
<%
do while not rs.eof
%>
<option selected value="<%=trim(rs("id"))%>"><%=trim(rs("class"))%></option>
<%
rs.movenext
loop
%>
</select>
<% end if
rs.close
set rs = nothing
conn.Close
set conn = nothing
%>
<select name="id">
<option selected value="">==请选小类==</option>
</select>**此为联动菜单,你必须动了大类,小类才有显示
</td></tr>