回 帖 发 新 帖 刷新版面

主题:提个问题?

<%
        sql = "select * from BigClass"
        rs.open sql,conn,1,1
        if rs.eof and rs.bof then
            response.write "请先添加栏目。"
        else
        %>
                    <select name="select" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
                      <option selected value="<%=trim(rs("BigClassName"))%>"><%=replace(trim(rs("BigClassName")),"Y","and")%></option>
                      <%
            dim selclass1
            selclass1=rs("BigClassName")
            rs.movenext
            do while not rs.eof
            %>
                      <option value="<%=trim(rs("BigClassName"))%>"><%=replace(trim(rs("BigClassName")),"Y","and")%></option>
                      <%
                rs.movenext
            loop
        end if
        rs.close
            %>
                    </select>
                    <select name="select">
                      <option value="" selected>不指定小类</option>
                      <%
            sql="select * from SmallClass where BigClassName='" & selclass1 & "'"
            rs.open sql,conn,1,1
            if not(rs.eof and rs.bof) then
            %>
                      <option value="<%=rs("SmallClassName")%>"><%=replace(rs("SmallClassName"),"Y","and")%></option>
                      <% rs.movenext
                do while not rs.eof%>
                      <option value="<%=rs("SmallClassName")%>"><%=replace(rs("SmallClassName"),"Y","and")%></option>
                      <%
                    rs.movenext
                loop
            end if
            rs.close
            rs1.close
            %>
                      <%
            ranNum=int(9*rnd)+10
            iddata=month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum
            %>
                    </select>
怎么在让select中的值只选择表中某个特定的字段

回复列表 (共2个回复)

沙发

你是不是想做二级联动?

板凳

本来联动已经写好了,也能用了!但是我想在后台做个控制,让特定的管理员登陆只能选择特定的select中的选项

我来回复

您尚未登录,请登录后再回复。点此登录或注册