E
enjoywork44
Unregistered / Unconfirmed
GUEST, unregistred user!
本已实现了菜单级联问题,即根据前一个菜单的选择,后面的菜单从数据库提取相应的内容,但是现在想实现的时后面两个菜单都要进行相应的提取,不知道如何做?初接触此领域,请大侠们多赐教,谢谢
原有的代码如下,正常运行
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset"
sql = "select * from projecttotal "
rs.open sql,conn,1,1
%>
<SCRIPT language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do
while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("pjy")%>","<%= trim(rs("xmdm")%>","<%= trim(rs("xmmc")%>"
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
do
cument.form1.pjy.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount;
i++)
{
if (subcat[1] == locationid)
{
do
cument.form1.pjy.options[document.form1.pjy.length] = new Option(subcat[0], subcat[0]);
}
}
}
根据自己的理解,又在后面添加了xmmc这个菜单项,结果提示错误
<%dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset"
sql = "select * from projecttotal "
rs.open sql,conn,1,1%>
<SCRIPT language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<% count = 0
do
while not rs.eof %>
subcat[<%=count%>] = new Array("<%= trim(rs("pjy")%>","<%= trim(rs("xmdm")%>","<%= trim(rs("xmmc")%>"
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{ do
cument.form1.pjy.length = 0;
do
cument.form1.xmmc.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount;
i++)
{
if (subcat[1] == locationid)
{ do
cument.form1.pjy.options[document.form1.pjy.length] = new Option(subcat[0], subcat[0]);
document.form1.xmmc.options[document.form1.xmmc.length] = new Option(subcat[0], subcat[0]);
}
}
}
原有的代码如下,正常运行
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset"
sql = "select * from projecttotal "
rs.open sql,conn,1,1
%>
<SCRIPT language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do
while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("pjy")%>","<%= trim(rs("xmdm")%>","<%= trim(rs("xmmc")%>"
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
do
cument.form1.pjy.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount;
i++)
{
if (subcat[1] == locationid)
{
do
cument.form1.pjy.options[document.form1.pjy.length] = new Option(subcat[0], subcat[0]);
}
}
}
根据自己的理解,又在后面添加了xmmc这个菜单项,结果提示错误
<%dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset"
sql = "select * from projecttotal "
rs.open sql,conn,1,1%>
<SCRIPT language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<% count = 0
do
while not rs.eof %>
subcat[<%=count%>] = new Array("<%= trim(rs("pjy")%>","<%= trim(rs("xmdm")%>","<%= trim(rs("xmmc")%>"
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{ do
cument.form1.pjy.length = 0;
do
cument.form1.xmmc.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount;
i++)
{
if (subcat[1] == locationid)
{ do
cument.form1.pjy.options[document.form1.pjy.length] = new Option(subcat[0], subcat[0]);
document.form1.xmmc.options[document.form1.xmmc.length] = new Option(subcat[0], subcat[0]);
}
}
}