日期:2014-05-17  浏览次数:20856 次

下拉菜单取值
汽车品牌:
                                <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& " ' "中做查询条件。请各位高手指点

------解决方案--------------------
选汽车品牌的时候要提交一下
要不rs_s.open "select * From Abrand where kind= ' "&a& " ' ",conn,1,1
的时候会取不到a的值

或者使用xmlhttp
------解决方案--------------------
<select name= "brand " onchange= "location.href= '本页?a= '+ this.value ">
<option> ==请选择== </option>
</select>

dim a
a = Request.Querystring( "a ")

然后 执行你的代码就可以了
select * From Abrand where kind= ' "&a& " ' "
------解决方案--------------------
把汽车品牌放到form 中提交,车类选择接收
dim a
a=request.form( "brand ")