有请高手帮忙看一下小弟我这个动态三级联动哪里出错了???
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="../../Connections/connms.asp" -->
<%
Dim C01
Dim C01_numRows
Set C01 = Server.CreateObject("ADODB.Recordset")
C01.ActiveConnection = MM_connms_STRING
C01.Source = "SELECT * FROM MS_MainCatalog"
C01.CursorType = 0
C01.CursorLocation = 2
C01.LockType = 1
C01.Open()
C01_numRows = 0
%>
<%
Dim C02
Dim C02_numRows
Set C02 = Server.CreateObject("ADODB.Recordset")
C02.ActiveConnection = MM_connms_STRING
C02.Source = "SELECT * FROM MS_catalog"
C02.CursorType = 0
C02.CursorLocation = 2
C02.LockType = 1
C02.Open()
C02_numRows = 0
%>
<%
Dim C03
Dim C03_numRows
Set C03 = Server.CreateObject("ADODB.Recordset")
C03.ActiveConnection = MM_connms_STRING
C03.Source = "SELECT * FROM MS_products"
C03.CursorType = 0
C03.CursorLocation = 2
C03.LockType = 1
C03.Open()
C03_numRows = 0
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" contect"thousymo">
<title>无标题文档</title>
</head>
<body>
<!-- 三级联动 Start -->
<script language="javascript">
<!--
var subval = new Array();
//subval[0] = new Array('10','单数','1','=1')
<%
howmanygroupss=0
%>
<%
While (NOT C03.EOF)
%>
subval[<%=howmanygroupss%>] = new Array('<%=(C03.Fields.Item("mctl_name_cht").Value)%>','<%=(C03.Fields.Item("ctl_name_cht").Value)%>','<%=(C03.Fields.Item("cpxh_name_cht").Value)%>','<%=(C03.Fields.Item("cpxh_name_cht").Value)%>')
<%howmanygroupss=howmanygroupss+1%>
<%
C03.MoveNext()
Wend
If (C03.CursorType > 0) Then
C03.MoveFirst
Else
C03.Requery
End If
%>
//subval[数组] = new Array('一级的值','二级的值','三级标签','三级的值')
function changeselect2()
{
document.form2.s2.length = 0;
document.form2.s2.options[0] = new Option('==请选择==','');
//document.form2.s2.options[1] = new Option('选择单数','单数');
<%
howmanygroups=0
%>
<%
While (NOT C02.EOF)
%>
document.form2.s2.options[<%=howmanygroups%>] = new Option('<%=(C02.Fields.Item("ctl_name_cht").Value)%>','<%=(C02.Fields.Item("mctl_cp_cht").Value)%>');
<%howmanygroups=howmanygroups+1%>
<%
C02.MoveNext()
Wend
If (C02.CursorType > 0) Then
C02.MoveFirst
Else
C02.Requery
End If
%>
document.form2.s3.length = 0;
document.form2.s3.options[0] = new Option('==请选择==','');
}
function changeselect3(sub1,sub2)
{
document.form2.s3.length = 0;
document.form2.s3.options[0] = new Option('==请选择==','');
for (i=0; i<subval.length; i++)
{
if ((subval[i][0] == sub1) & (subval[i][1] == sub2))
{document.form2.s3.options[document.form2.s3.length] = new Option(subval[i][2], subval[i][3]);}
}
}
//-->
</script>
<form name="form2">
三级联动:
<select name="s1" onChange="changeselect2()">
<option value="">==请选择==</option>
<%
While (NOT C01.EOF)
%>
<option value="<%=(C01.Fields.Item("mctl_name_cht").Value)%>"><%=(C01.Fields.Item("mctl_name_cht").Value)%></option>
<%
C01.MoveNext()
Wend
If (C01.CursorType > 0) Then
C01.MoveFirst
Else
C01.Requery
End If
%>
</select>
<select name="s2" onChange="changeselect3(document.form2.s1.value,this.value)">
<option>==请选择==</option>
</select>
<select name="s3" onChange="alert(this.value)">
<option>==请选择==</option>
</select>
</form>
<!-- 三级联动 Over -->
</body>
</html>
<%
C01.Close()
Set C01 = Nothing
%>
<%
C02.Close()
Set C02 = Nothing
%>
<%
C03.Close()
Set C03 = Nothing
%>