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

📄 query.asp

📁 产品管理系统 <script language="JavaScript" src="js.asp?nclassid=1"> js.asp改成你的本文件的url nclassid可以改成cl
💻 ASP
字号:
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from ANclass order by Nclassid asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= trim(rs("classid"))%>","<%= trim(rs("Nclassid"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.Nclassid.length = 1; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<form method="post" name="myform" action="ru_query.asp">
  <div align="center">
    <select name="action" size="1" class="smallinput" >
      <option value="title">产品名称..</option>
      <option value="content">产品描述..</option>
      <option value="price">产品价格..</option>
    </select>
    <br>
    <select name="classid" class="smallinput"  onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1">
      <option selected value="">未指定条件</option>
      <% 
        
        sql = "select * from Aclass"
        rs.open sql,conn,1,1
        do while not rs.eof
        %>
      <option value="<%=trim(rs("classid"))%>"><%=trim(rs("class"))%></option>
      <%
        rs.movenext
        loop
        rs.close
        %>
    </select>
    <br>
    <select name="Nclassid" class="smallinput" >
      <option selected value="" >未指定条件</option>
    </select>
    <br>
    <input type="text" name="keyword" class="smallinput" size=10 value="关键字" maxlength="50">
    <br>
    <input type="submit" name="Submit" class="buttonface" value="产品查询">
  </div>
</form>

⌨️ 快捷键说明

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