日期:2012-08-29  浏览次数:21063 次

  
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0"  class="font">
  <tr> 
      <td height="44" align="right">产品编号:</td>
      <td align="left"><input name="pro_id"></td>
    </tr>
   <tr> 
      <td height="41" align="right"> 
        <%
set rs=server.CreateObject("adodb.recordset")
sq="select * from pro_big_part"
rs.open sq,conn,1,1%>
        <select  name="big_part"  onChange="ld();ld2()">
          <option value="" selected>选择一级目录</option>
          <%while not rs.eof%>
          <option value="<%=rs("big_part")%>"><%=rs("big_part")%></option>
          <%rs.movenext
wend
rs.close%>
        </select> </td>
      <td align="left"> <select  name="small_part" onChange="ld2()">
          <option value="" selected>选择二级目录</option>
        </select>   <select  name="thr_part">
          <option value="" selected>选择三级目录</option>
        </select> 
        <%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
%>
<!--下面是实现动态改变下一级菜单的脚本代码-->
        <script  LANGUAGE="javascript">
arr="<%=str%>".split(",");
a=arr.length
ar=new Array()
for (i=0;i<a;i++){
  ar[i]=arr[i].split("-");
}
onecount=ar.length;
arr2="<%=str2%>".split(",");
a2=arr2.length
ar2=new Array()
for (i=0;i<a2;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<onecount;i++)  {