function changelocation(locationid)
{ document.goalerform.SmallClassID.length = 0;var locationid=locationid;
var i;for (i=0;i < j; i++){ if (goaler[i][1] == locationid){ document.goalerform.SmallClassID.options[document.goalerform.SmallClassID.length] = new Option(goaler[i][0], goaler[i][2]);} }}
</script><form method="post" name="goalerform" action="">
<select name="BigClassID" onChange="changelocation(document.goalerform.BigClassID.options[document.goalerform.BigClassID.selectedIndex].value)" size="1"><%set rs=conn.execute("select * from BigClass order by BigClassID")if rs.eof then%><option selected value="">无一级分类</option><%else%><option selected value="">请选择一级分类</option><%do while not rs.eof%><option value="<%=rs("BigClassID")%>"><%=rs("BigClassName")%></option><%rs.movenextloopend if%></select><select name="SmallClassID"><option selected value="">未指定一级分类</option></select><input type="submit" name="goaler" value="提交"></form> <%'测试取值if request("goaler")<>"" thenresponse.write "BigClassID="&request("BigClassID")&"<BR>SmallClassID="&request("SmallClassID")end if%>--------==========================================================-----------------------
可能程序还有其它的同名的RECORDSET,为防止影响。可以改为
<%SmallClassID=request.form("SmallClassID")if SmallClassID<>"" thenset dansin=conn.execute("select titlename from News where Smallclassid="&SmallClassIDif not dansin.eof then do while not rs.eof response.write(dansin("titlename")) dansin.movenext loopend ifdansin.closeelseresponse.write("SmallClassID值为空")end if <!-- #include virtual = "/include/conn.asp" --><%SmallClassID=request.form("SmallClassID")if SmallClassID<>"" thenset rs=conn.execute("select page_name from News where Smallclassid=" & SmallClassID)if not rs.eof then do while not rs.eof response.write(rs("page_name")) rs.movenext loopend ifelseresponse.write("SmallClassID值为空")end ifrs.closeconn.close%>