• ASP新闻栏目切换+JS


    <%
    dim rs
    dim sql
    dim count
    set rs=server.createobject("adodb.recordset")
    sql = "select * from kml_sclass"
    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("sclassname"))%>","<%= trim(rs("bclassid"))%>","<%= trim(rs("sclassid"))%>");
            <%
            count = count + 1
            rs.movenext
            loop
            rs.close
            %>
    onecount=<%=count%>;

    function changelocation(locationid)
        {
        document.myform.sclassid.length = 0;

        var locationid=locationid;
        var i;
        for (i=0;i < onecount; i++)
            {
                if (subcat[i][1] == locationid)
                {
                  document.myform.sclassid.options[document.myform.sclassid.length] = new Option(subcat[i][0], subcat[i][2]);
                }       
            }
           
        }   
    </script>

    </head>
    <body>
    <br>
    <form name="myform" method="post" action="?action=addsave">
    <table width="80%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
      <tr bgcolor="#F6F6F6">
        <td height="25" colspan="2"><div align="center"><strong>修 改 新 闻</strong></div></td>
      </tr><tr bgcolor="#F6F6F6"><td align="center" height="25">新闻样式:</td><td><input name="jibie" type="radio" value="0" checked>
              中文版</td></tr>
      <tr>
        <td width="15%" height="25" align="right" bgcolor="#F6F6F6">文章类型:</td>
        <td width="85%" bgcolor="#FFFFFF">
    <%
        sql = "select * from kml_bclass"
        rs.open sql,conn,1,1
     if rs.eof and rs.bof then
     response.write "请先添加栏目。"
     response.end
     else
    %>
    <select name="bclassid" onChange="changelocation(document.myform.bclassid.options[document.myform.bclassid.selectedIndex].value)" size="1">
            <option selected value="<%=trim(rs("bclassid"))%>"><%=trim(rs("bclassname"))%></option>
            <%dim selclass
             selclass=rs("bclassid")
            rs.movenext
            do while not rs.eof
    %>
    <option value="<%=trim(rs("bclassid"))%>"><%=trim(rs("bclassname"))%></option>
    <%
    rs.movenext
    loop
    end if
    rs.close
    %>
          </select>
          <select name="sclassid">
    <%
    sql="select * from kml_sclass where bclassid="&selclass
    rs.open sql,conn,1,1
    if not(rs.eof and rs.bof) then
    %>
            <option selected value="<%=rs("sclassID")%>"><%=rs("sclassname")%></option>
    <%
    rs.movenext
    do while not rs.eof
    %>
    <option <%if RsEdit("sclassid")=rs("sclassID") then %> selected <% end if %>value="<%=rs("sclassID")%>"><%=rs("sclassname")%></option>
    <%
    rs.movenext
    loop
    end if
            rs.close
            set rs = nothing
    %>
    </select>

  • 相关阅读:
    Day 83 VUE——组件、插槽、生命周期
    Power BI制作GDP动态排行榜
    SQL中为什么经常要加WITH(NOLOCK)
    ant-desin-vue——table全选时自定义的禁用行也被选上,且最后一行不选中问题
    ant-design-vue——a-select下拉框值为空字串时,高度偏窄问题
    ant-desgin-vue——tree自定义节点不可选用的置灰或禁用
    js——在A页面打开新页面B,关闭新页面B后刷新A页面
    Vue You may have an infinite update loop in a component render function.
    js实现继承的方法中为何总是要修正constructor方法的指向呢?
    Spring boot 扫描不到 mybatis 接口包
  • 原文地址:https://www.cnblogs.com/tdalcn/p/691008.html
Copyright © 2020-2023  润新知