您的位置:程序门 -> web 开发 -> asp



下拉菜单取值


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


下拉菜单取值[已结贴,结贴人:aomin1981]
发表于:2007-07-18 15:39:39 楼主
汽车品牌:
                                <select   name= "brand ">
                                    <option> ==请选择== </option>
                                </select>
车类选择:
<%
dim   rs_s
set   rs_s=server.createobject( "adodb.recordset ")
rs_s.open   "select   *   from   abrand   where   kind= ' "&a& " ' ",conn,1,1
%>
<select   name= "sort "   class= "wenbenkuang "   id= "sort "   onchange= "(document.myform.sort.value=this.options[this.selectedindex].value) ">
    <option   selected> </option>
    <%
while   not   rs_s.eof
%>
    <option   value= " <%=rs_s( "shop ")%> "> <%=rs_s( "shop ")%> </option>
    <%
rs_s.movenext
wend
rs_s.close
set   rs_s=nothing
%>
</select>

我想取brand菜单中的值用在这条语句 "select   *   from   abrand   where   kind= ' "&a& " ' "中做查询条件。请各位高手指点
发表于:2007-07-18 15:45:281楼 得分:10
选汽车品牌的时候要提交一下
要不rs_s.open   "select   *   from   abrand   where   kind= ' "&a& " ' ",conn,1,1
的时候会取不到a的值

或者使用xmlhttp
发表于:2007-07-18 15:48:382楼 得分:20
<select   name= "brand "   onchange= "location.href= '本页?a= '+   this.value ">
                <option> ==请选择== </option>
  </select>
 
  dim   a  
  a   =   request.querystring( "a ")
               
  然后   执行你的代码就可以了
  select   *   from   abrand   where   kind= ' "&a& " ' "
发表于:2007-07-18 16:06:373楼 得分:0
忘记说了,brand菜单是一个三级联动菜单中的最后一个菜单。
发表于:2007-07-18 16:30:064楼 得分:20
把汽车品牌放到form   中提交,车类选择接收
dim   a
a=request.form( "brand ")


快速检索

最新资讯
热门点击