zoukankan      html  css  js  c++  java
  • 三级联动菜单 PENGHAO

    <!--#include file="conn.asp"--> 
    <% 
        dim bid,cid 
        bid 
    = request("bid")  'bid   大类id 
        cid 
    = request("cid")   'cid  中类id 

     '
    if bid="" then 
        'bid
    ="1" 
        'end 
    if 
     '
    if cid="" then 
        'cid
    ="1" 
        'end 
    if 
      
         set rs
    =server.createobject("adodb.recordset")   
         sql 
    = "select * from btype"    '表一  大类表 
         rs.open sql,conn,
    1,3 
         strOption1 
    = "<option value='' selected style='BACKGROUND-COLOR: #eeeeee; COLOR: #ff0000'>==请选择==</option>" 
               
    do while not rs.eof 
               
    if cstr(rs("id")) = cstr(bid) then 
                     strOption1 
    = strOption1 & "<option value='" & rs("id"& "' selected>" & rs("type"& "</option>" 
               
    else 
         
              strOption1 
    = strOption1 & "<option value='" & rs("id"& "'>" & rs("type"& "</option>" 
                
         end 
    if 
         rs.movenext       
                loop    
      
         rs.close 
         
         
    if bid <> "" then 
               sql 
    = "select * from mtype where bid=" & bid   '表二  中类表   bid==表一中的id 
             
         rs.open sql,conn,
    1,3 
               strOption2 
    = "<option value='' selected style='BACKGROUND-COLOR: #eeeeee; COLOR: #ff0000'>==请选择==</option>" 
        
               
    do while not rs.eof 
                     
    if cstr(rs("id")) = cstr(cid) then 
                           strOption2 
    = strOption2 & "<option value='" & rs("id"& "' selected>" & rs("type"& "</option>" 
                     
    else 
                           strOption2 
    = strOption2 & "<option value='" & rs("id"& "'>" & rs("type"& "</option>" 
                     end 
    if 
            rs.movenext 
               loop 
               rs.close 
         end 
    if 
         
         
    if cid <> "" then 
               sql 
    = "select * from stype where mid= " & cid  '表三   小类表  mid==表二的id 
               rs.open sql,conn,
    1,3 
               strOption3 
    = "<option value='' selected style='BACKGROUND-COLOR: #eeeeee; COLOR: #ff0000'>==请选择==</option>" 
               
    while not rs.eof 
               
    if cstr(rs("id")) = cstr(cid) then 
                           strOption3 
    = strOption3 & "<option value='" & rs("id"& "' selected>" & rs("type"& "</option>" 
                     
    else 
                           strOption3 
    = strOption3 & "<option value='" & rs("id"& "'>" & rs("type"& "</option>" 
                     end 
    if 
                     'strOption3 
    = strOption3 & "<option value='" & rs("id"& "'>" & rs("type"& "</option>" 
              
               rs.movenext 
               wend 
         rs.close 
         end 
    if 
         
    %> 
    <select onchange="changeb(this.value)" name="bid"><%=strOption1%></select> 
    <select onchange="change(this.value)" name="cid"><%=strOption2%></select> 
    <select name="typeid"><%=strOption3%></select> 
    <script language="javascript"> 
    <!-- 
         
    function changeb(bid){ 
               location.assign(
    "three.asp?bid=" + bid);   
         } 
         
         
    function change(cid){ 
               location.assign(
    "three.asp?bid=<%=bid%>&cid=" + cid);    
         } 
    --> 
    </script> 
  • 相关阅读:
    /etc/sysctl.conf 控制内核相关配置文件
    python 并发编程 非阻塞IO模型
    python 并发编程 多路复用IO模型
    python 并发编程 异步IO模型
    python 并发编程 阻塞IO模型
    python 并发编程 基于gevent模块 协程池 实现并发的套接字通信
    python 并发编程 基于gevent模块实现并发的套接字通信
    python 并发编程 io模型 目录
    python 并发编程 socket 服务端 客户端 阻塞io行为
    python 并发编程 IO模型介绍
  • 原文地址:https://www.cnblogs.com/Dove/p/118248.html
Copyright © 2011-2022 走看看