首 页 | 网页模板 | 教程 | 源码下载 | 书籍下载 | 图片素材 | 字体 | JAVA特效 | FLASH源码 | 软件 | 矢量 | 论坛 | 其它 |
设为主页
加入收藏
联系站长
平面设计 | 网页制作 | 程序编写 | 数 据 库 | 媒体动画 | 网络冲浪 | 服务器相关 |
当前在线
广告:P4服务器电信机房6999/年即送产权 | 疾风下载
基于数据库的三级菜单实现(二级同理)
2005-4-22 7:03:51  作者:模板天下收集整理  来源:未知 网友评论 0 条 论坛
  
   
      产品编号:
      
    
    
       
        <%
set rs=server.CreateObject("adodb.recordset")
sq="select * from pro_big_part"
rs.open sq,conn,1,1%>
        
          选择一级目录
          <%while not rs.eof%>
          "><%=rs("big_part")%>
          <%rs.movenext
wend
rs.close%>
         
       
          选择二级目录
           
          选择三级目录
         
        <%sql="select * from pro_small_part"
rs.open sql,conn,1,1
num=rs.recordcount
str=""
for i=1 to rs.recordcount
str=str&rs("big_part")&"-"&rs("small_part")&","
if rs.eof then exit for
rs.movenext
next
rs.close
%>
<%sql="select * from pro_thr_part"
rs.open sql,conn,1,1
num2=rs.recordcount
str2=""
for i=1 to rs.recordcount
str2=str2&rs("small_part")&"-"&rs("thr_part")&","
if rs.eof then exit for
rs.movenext
next
rs.close
%>

        
arr="<%=str%>".split(",");
a=arr.length
ar=new Array()
for (i=0;i  ar[i]=arr[i].split("-");
}
onecount=ar.length;
arr2="<%=str2%>".split(",");
a2=arr2.length
ar2=new Array()
for (i=0;i  ar2[i]=arr2[i].split("-");
}
onecount2=ar2.length;
function  ld() {
  document.form1.small_part.length=0
  lid=form1.big_part.value;       
  for  (i=0;i    if  (ar[i][0]  ==  lid) {
   document.form1.small_part.options.add(new Option(ar[i][1],  ar[i][1]));    
    }    
  }   
}   
function  ld2() {
  document.form1.thr_part.length=0
  lid2=form1.small_part.value;       
  for  (i=0;i    if  (ar2[i][0]  ==  lid2) {
   document.form1.thr_part.options.add(new Option(ar2[i][1],  ar2[i][1]));    
    }    
  }   
}   

    
共分1页  [1] 
>> 相关文章

关于网站 | 客服中心 | 服务条款 | 友情链接 | 广告联系 | 本站历程 | 网站导航

吉ICP备05000107号