现在,有两个下拉菜单,两者之间存在着相互依存的关系;点击第一个菜单,相应地第二个菜单就显示在前者前提条件下所有数据;主要是实时效应!
据个例子:
1
2response.buffer=true
3Response.Expires=0
4Set rs= Server.CreateObject ("ADODB.RecordSet")
5sql = "select * from customer "
6rs.open sql, conn,3,3
1<select name="c_name" onselect="selectState()">
2<option> ```
3
4do while not rs.eof
5response.write""&amp;rs("s_name")&amp;"<br/>"
6
7```</option>
8<option> ```
9 rs.movenext
10loop
11
12```</option>
13</select>
//第一下拉菜单
---------------------------
1<script language="javascript">
2function selectstate()
3{
4如何填写?
5}
6</script>
1
2Set rm= Server.CreateObject ("ADODB.RecordSet")
3sql = "select s_name from customer "
4rm.open sql, conn,3,3
1
2Set rec= Server.CreateObject ("ADODB.RecordSet")
3sqlstr = "select s_styleno from sample where s_customer='"&rm("s_name")&"'"
4rec.open sqlstr, conn,3,3
1<select name="s_no">
2<option>
do while not rec.eof
response.write""&rec("s_styleno")&"<br/>"
1</option>
2<option>
rec.movenext
loop
1</option>
2</select>
//第二下拉菜单
请尽快给我答复;多多益善!
---------------------------------------------------------------
给你例子
1
2kindname=request("kindname")
1<html>
2<head>
3<title>welcome to CBSources.com!</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<script language="vbscript">
5sub pop()
6kindname=search.kindname.value
7window.location="search1.asp?kindname="&kindname&" "
8end sub
9</script>
10</head>
11<body bgcolor="#FFFFFF" text="#000000" topmargin="5">
12<br/><form action="index.asp" method="post" name="search">
13<table align="CENTER" border="0" cellpadding="2" cellspacing="3" class="bgColor1" width="533">
14<tr>
15<td width="519"> <select name="kindname" onchange="pop()" size="1">
16<option value="安全、防护"></option>
17<option "selected"="" ```="" if="" kindname="安全、防护" response.write="" then="" value="安全、防护">安全、防护</option>
18<option "selected"="" ```="" if="" kindname="包装、印刷" response.write="" then="" value="包装、印刷">包装、印刷</option>
19<option "selected"="" ```="" if="" kindname="办公文教、光仪" response.write="" then="" value="办公文教、光仪">办公文教、光仪</option>
20<option "selected"="" ```="" if="" kindname="家居用品" response.write="" then="" value="家居用品">家居用品</option>
21<option "selected"="" ```="" if="" kindname="电子电工" response.write="" then="" value="电子电工">电子电工</option>
22<option "selected"="" ```="" if="" kindname="家用电器" response.write="" then="" value="家用电器">家用电器</option>
23<option "selected"="" ```="" if="" kindname="服饰" response.write="" then="" value="服饰">服饰</option>
24<option "selected"="" ```="" if="" kindname="纺织、皮革" response.write="" then="" value="纺织、皮革">纺织、皮革</option>
25<option "selected"="" ```="" if="" kindname="机械、工业制品" response.write="" then="" value="机械、工业制品">机械、工业制品</option>
26<option "selected"="" ```="" if="" kindname="化工、环保、能源" response.write="" then="" value="化工、环保、能源">化工、环保、能源</option>
27<option "selected"="" ```="" if="" kindname="农业、农副产品" response.write="" then="" value="农业、农副产品">农业、农副产品</option>
28<option "selected"="" ```="" if="" kindname="建材、房地产" response.write="" then="" value="建材、房地产">建材、房地产</option>
29<option "selected"="" ```="" if="" kindname="交通、运输" response.write="" then="" value="交通、运输">交通、运输</option>
30<option "selected"="" ```="" if="" kindname="汽摩及配件" response.write="" then="" value="汽摩及配件">汽摩及配件</option>
31<option "selected"="" ```="" if="" kindname="礼品、工艺品及玩具" response.write="" then="" value="礼品、工艺品及玩具">礼品、工艺品及玩具</option>
32<option "selected"="" ```="" if="" kindname="食品、饮料" response.write="" then="" value="食品、饮料">食品、饮料</option>
33<option "selected"="" ```="" if="" kindname="通讯产品" response.write="" then="" value="通讯产品">通讯产品</option>
34<option "selected"="" ```="" if="" kindname="冶金、矿产" response.write="" then="" value="冶金、矿产">冶金、矿产</option>
35<option ```="" if="" kindname="库存积压" response.write"selected"="" then="" valve="库存积压">库存积压</option>
36</select> </td>
37<td width="346"><span class="smallest">
if kindname="" then
1<select name="partkind" size="1">
2<option value=""></option>
3<option>&lt;\-----------------&gt;</option>
4<option value=""></option>
5<option value=""></option>
6<option value=""></option>
7</select>
8</span><span class="smallest">
else
1<select name="partkind" size="1">
set rs=strconn.execute("select * from kind where kindname='"&kindname&"' ")
kindid=rs("id")
rs.close
set rs=nothing
set sqlrs=strconn.execute("select * from kind where kindid="&kindid&" ")
do while not sqlrs.eof
1<option ```"="" kindname")="" value="```
2=sqlrs(">```
3=sqlrs("kindname")
4```</option>
sqlrs.movenext
if sqlrs.eof then exit do
loop
sqlrs.close
set sqlrs=nothing
end if
1</select>
2</span></td>
3<td width="194">.</td>
4</tr>
5</table>
6</form><br/>
7</body>
8</html>