⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yx.asp

📁 进入后台
💻 ASP
字号:
<%sub yx
set rs2=server.createobject("adodb.recordset")
	dim count
	rs2.open "select * from yx where lb=0 order by yxid,id",conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs2.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs2("yxname"))%>","<%= trim(rs2("yxid"))%>","<%= trim(rs2("yxname"))%>");
        <%
        count = count + 1
        rs2.movenext
        loop
        rs2.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    
</script><select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
	<option selected value="">选择院系</option>
<%rs.open "select * from yx where lb=1 order by id",conn,1,1
if not (rs.bof and rs.eof) then
	do while not rs.eof
        response.Write "<option value='" & trim(rs("id")) & "'>" & trim(rs("yxname")) & "</option>"
	   	rs.movenext
	loop
end if
rs.close
%>
</select><select name="SmallClassName">                  
    <option selected value="">所有小类</option>
</select>
<%end sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -