<!--#include file="Include/conig.asp"-->
<%
sql = "select * from zhi_rui_s_meshi where id=3"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
classid=rs("classid")
Topid=rs("Topid")
rs.close
set rs=nothing
Response.Write(classid&"_"&Topid)
%>
<script language="javascript" type="text/javascript">
var onecount;
subcat = new Array();
<%
Set rs=Conn.Execute("Select * From [zhi_rui_s_io_Class] where topid<>0")
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=trim(rs("id"))%>","<%= trim(rs("TopID"))%>","<%= trim(rs("ClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close:set rs=nothing
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form.Topid.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form.Topid.options[document.form.Topid.length] = new Option(subcat[i][2], subcat[i][0]);
}
}
}
</script>
<form method="post" action="ru_query.asp" name="form" id="form">
<select class='common-input' name="ClassId" onChange="changelocation(this.value)">
<option value="">请选择大类</option>
<% sql2 = "select * from zhi_rui_s_io_Class where topid=0"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='<%=rs2("id")%>' <% if cint(classid)=cint(rs2("id")) then response.write "selected" %>><%=rs2("ClassName")%></option>
<%
rs2.movenext
wend
rs2.close
set rs2=nothing
%>
</select>
<select class='common-input' name="Topid">
<option value="">请选择小类</option>
<% sql2 = "select * from zhi_rui_s_io_Class where topid="&cint(classid)&" order by id asc"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='<%=rs2("id")%>' <% if cint(Topid)=cint(rs2("id")) then response.write "selected" %>> <%=rs2("ClassName")%></option>
<%
rs2.movenext
wend
rs2.close
set rs2=nothing
%>
</select>
</form>