| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 491 人关注过本帖
标题:下拉列表框问题
只看楼主 加入收藏
xlfwh
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-10-28
收藏
 问题点数:0 回复次数:0 
下拉列表框问题
这是三级联动的下拉列表框,我想将最后一个下拉列表的取值改为其它数据库,条件为 where entrycode like '%"&第二个下拉列表框的值&"%',但是不知怎么加第二个下拉列表的这个值,不知是该怎么取? <%
  <script language="javascript" >
function changelocation(locationid)
    {
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from Tx_PrClass "
rs.open sql,conn,1,1
%>
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof
        %>
subcat[ <%=count%>] = new Array(" <%= trim(rs("class_name"))%>"," <%= trim(rs("ParentID"))%>"," <%= trim(rs("class_id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
set rs=Nothing
        %>
onecount= <%=count%>;
    document.form1.listRight.length = 0;
    var locationid=locationid;
    var i;
document.form1.listRight.options[0] = new Option('仪器品牌','1000','1000');
    for (i=1;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            {
                document.form1.listRight.options[document.form1.listRight.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }  
function changelocation1(locationid)
    {
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from Tx_PrClass "
rs.open sql,conn,1,1
%>
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof
        %>
subcat[ <%=count%>] = new Array(" <%= trim(rs("class_name"))%>"," <%= trim(rs("ParentID"))%>"," <%= trim(rs("class_id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
set rs=Nothing
        %>
onecount= <%=count%>;

document.form1.listRight1.length = 0;

    var locationid=locationid;
    var i;
document.form1.listRight1.options[0] = new Option('仪器型号','1000','1000');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            {
                document.form1.listRight1.options[document.form1.listRight1.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }

  
        
    }  

</script>
<style type="text/css">
<!--
.style93 { COLOR: #ffffff
}
.Table8 {
padding-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
font-variant: normal;
border:#CCCCCC 1px solid;
}
-->
</style>
  <TABLE class=table1  cellSpacing=0 cellPadding=0 width=780 align=center bgColor=#ffffff border=0>
  <TR>
    <TD vAlign=top>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD bgColor=#666666 height=25>&nbsp; <SPAN class=style93> <FONT
            color=#ffffff>您的位置: </FONT> <A
            class=menu href="./"> <FONT
            color=#ffffff>首页 </A> <FONT
            color=#ffffff>&nbsp;&gt;&gt;&nbsp;配件检索 </FONT> </SPAN> </TD> </TR>
        <TR>
          <TD bgColor=#d7dddd height=4> </TD> </TR> </TBODY> </TABLE>
      <TABLE height="100%" cellSpacing=1 cellPadding=0 width="100%" align=center
      bgColor=#ffffff border=0>
        <TBODY>
<tr> <td colspan="5"> <span style="font-family: &quot;宋体&quot;; font-weight: bold; font-size: 12px">请选择: </span> </td>
</tr>
            <FORM name=form1 action=products_list.asp method=post >
              <TR bgcolor=#ffffff>
                <TD height=23 > <%
Table_List="Tx_PrClass"
Set rs=server.createobject("Adodb.Recordset")
Sql="Select * from "& Table_List &" where ParentID=0 order by Class_Order ASC"
rs.open Sql,conn,1,1
P_C_N=split(Rs("Class_ParentPath"),"|")
P_C_N3=trim(Rs("Class_Id")) %>
      <SELECT style="WIDTH: 150px; border: 1px solid #c2c2c2; " onchange="changelocation(document.form1.listLeft.options[document.form1.listLeft.selectedIndex].value)" id="listLeft"                  
                  name=listLeft >
  <OPTION value="1000" selected>仪器类型 </OPTION>
                  <%
  While not rs.eof
  %>
                  <option value=" <%=rs("Class_Id")%>"> <%=rs("Class_Name")%> </option>
                  <%
rs.movenext
Wend
%>
<%
rs.close
set rs=Nothing
%>
    </SELECT> </TD>
                <TD width="200" height=23 align=middle>
          <SELECT style="WIDTH: 150px;border: 1px solid #c2c2c2;" onchange="changelocation1(document.form1.listRight.options[document.form1.listRight.selectedIndex].value)"  id=listRight        
                  name=listRight>
        <OPTION value="1000"selected>仪器品牌 </OPTION>
        </SELECT>
          </TD>
                <TD width="190" height=23 align=middle >&nbsp;&nbsp;&nbsp;
      <SELECT style="WIDTH: 150px;border: 1px solid #c2c2c2;"  name="listRight1" id=listRight1>
                    <option selected value="1000">仪器型号 </option>
    </SELECT> </TD>
              <TR>
搜索更多相关主题的帖子: 列表 
2008-10-28 12:19
快速回复:下拉列表框问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.046705 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved