asp三级联动,第一级选择了,第二级和第三级没反应,代码要怎么修改呢?
<scriptlanguage="JavaScript"><!--<%Dimcount2,rsClass2,sqlClass2setrsClass2=server.cre...
<script language="JavaScript">
<!--
<%
Dim count2,rsClass2,sqlClass2
set rsClass2=server.createobject("adodb.recordset")
sqlClass2="select * from LY_bclass"
rsClass2.open sqlClass2,conn,1,1
%>
var subval2 = new Array();
<%
count2 = 0
do while not rsClass2.eof
%>
subval2[ <%=count2%>] = new Array(' <%=rsClass2("bclassid")%>',' <%=rsClass2("classid")%>',' <%=rsClass2("bclassen")%>')
<%
count2 = count2 + 1
rsClass2.movenext
loop
rsClass2.close
%>
<%
Dim count3,rsClass3,sqlClass3
set rsClass3=server.createobject("adodb.recordset")
sqlClass3="select * from LY_sclass"
rsClass3.open sqlClass3,conn,1,1
%>
var subval3 = new Array();
<%
count3 = 0
do while not rsClass3.eof
%>
subval3[ <%=count3%>] = new Array(' <%=rsClass3("nclassid")%>','<%=rsClass3("bclassid")%>',' <%=rsClass3("nclassen")%>')
<%
count3 = count3 + 1
rsClass3.movenext
loop
rsClass3.close
%>
function changeselect1(locationid)
{
document.form1.s2.length = 0;
document.form1.s2.options[0] = new Option('-- Please select the server --','');
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('-- Please select the product --','');
for (i=0; i <subval2.length; i++)
{
if (subval2[i][0] == locationid)
{document.form1.s2.options[document.form1.s2.length] = new Option(subval2[i][2],subval2[i][1]);}
}
}
function changeselect2(locationid)
{
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('-- Please select the product --','');
for (i=0; i <subval3.length; i++)
{
if (subval3[i][0] == locationid)
{
document.form1.s3.options[document.form1.s3.length] = new Option(subval3[i][2],subval3[i][1]);
}
}
}
//-->
</script> 展开
<!--
<%
Dim count2,rsClass2,sqlClass2
set rsClass2=server.createobject("adodb.recordset")
sqlClass2="select * from LY_bclass"
rsClass2.open sqlClass2,conn,1,1
%>
var subval2 = new Array();
<%
count2 = 0
do while not rsClass2.eof
%>
subval2[ <%=count2%>] = new Array(' <%=rsClass2("bclassid")%>',' <%=rsClass2("classid")%>',' <%=rsClass2("bclassen")%>')
<%
count2 = count2 + 1
rsClass2.movenext
loop
rsClass2.close
%>
<%
Dim count3,rsClass3,sqlClass3
set rsClass3=server.createobject("adodb.recordset")
sqlClass3="select * from LY_sclass"
rsClass3.open sqlClass3,conn,1,1
%>
var subval3 = new Array();
<%
count3 = 0
do while not rsClass3.eof
%>
subval3[ <%=count3%>] = new Array(' <%=rsClass3("nclassid")%>','<%=rsClass3("bclassid")%>',' <%=rsClass3("nclassen")%>')
<%
count3 = count3 + 1
rsClass3.movenext
loop
rsClass3.close
%>
function changeselect1(locationid)
{
document.form1.s2.length = 0;
document.form1.s2.options[0] = new Option('-- Please select the server --','');
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('-- Please select the product --','');
for (i=0; i <subval2.length; i++)
{
if (subval2[i][0] == locationid)
{document.form1.s2.options[document.form1.s2.length] = new Option(subval2[i][2],subval2[i][1]);}
}
}
function changeselect2(locationid)
{
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('-- Please select the product --','');
for (i=0; i <subval3.length; i++)
{
if (subval3[i][0] == locationid)
{
document.form1.s3.options[document.form1.s3.length] = new Option(subval3[i][2],subval3[i][1]);
}
}
}
//-->
</script> 展开
1个回答
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询