我要做一个二级联动下拉菜单,两个selected要放在不同的td里面,不能用form,求代码!

 我来答
roobie
2008-12-01 · TA获得超过1387个赞
知道小有建树答主
回答量:947
采纳率:0%
帮助的人:820万
展开全部
我的asp代码,你改下用用就行了
------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>数据信息查询</title>
</head>

<body background="../imag/lu.jpg">
<p><br></p>
<p></p>
<p></p>
<form id="form1" name="formcx" method="post">
<table borderColor="#008080" cellSpacing="1" cellPadding="0" width="442" align="center" border="1" height="12" style="word-break:break-all">
<tr>
<td width="434" align="center" height="12">
<table borderColor="#336699" height="103" width="504" border="1">
<tbody>
<tr>
<td align="center" width="500" height="28" colspan="4">
<p align="center">  <font color="#ff0000"><b>信 息 查 询</b></font></p></td></tr>
<tr>
<td align="center" width="526" height="28" colspan="4"> </td></tr>
<tr>
<td align="center" width="108" height="28">
<p align="center"><font size="3" color="#008000"><b>查询类别</b></font></p>
</td>
<td align="center" width="108" height="28">
<p align="left">
<select name="cxlb" onChange="javascript:document.getElementById('formcx').submit();">
<%
dim select_xw
if request.form("cxlb") = "99" then
select_daily = ""
select_xw = ""
select_money = ""
end if

if request.form("cxlb") = "1" then
select_xw = "selected"
else
select_xw = ""
end if

dim select_daily
if request.form("cxlb") = "2" then
select_daily = "selected"
else
select_daily = ""
end if

dim select_money
if request.form("cxlb") = "3" then
select_money = "selected"
else
select_money = ""
end if
%>

<option value="99"></option>
<option value="1" <%=select_xw%>>新闻信息</option>
<option value="2" <%=select_daily%>>日记信息</option>
<option value="3" <%=select_money%>>资金信息</option>
</select>
</p></td>
<td align="center" width="108" height="28">
<p align="center"><font size="3" color="#008000"><b>类别信息</b></font></p></td>
<td align="center" width="176" height="28">
<p align="left">
<select name="lbxx" onChange="javascript:document.getElementById('formcx').submit();">
<option value="99">所有信息</option>

<%
if request.form("cxlb") = "1" then

dim select_tlxx
if request.form("lbxx") = "1" then
select_tlxx = "selected"
else
select_tlxx = ""
end if

dim select_zrkx
if request.form("lbxx") = "2" then
select_zrkx = "selected"
else
select_zrkx = ""
end if

dim select_lswh
if request.form("lbxx") = "3" then
select_lswh = "selected"
else
select_lswh = ""
end if

dim select_zhxw
if request.form("lbxx") = "4" then
select_zhxw = "selected"
else
select_zhxw = ""
end if

dim select_aqxx
if request.form("lbxx") = "5" then
select_aqxx = "selected"
else
select_aqxx = ""
end if

dim select_dlxx
if request.form("lbxx") = "6" then
select_dlxx = "selected"
else
select_dlxx = ""
end if

dim select_jkcs
if request.form("lbxx") = "7" then
select_jkcs = "selected"
else
select_jkcs = ""
end if

dim select_cjxx
if request.form("lbxx") = "8" then
select_cjxx = "selected"
else
select_cjxx = ""
end if

dim select_jyjt
if request.form("lbxx") = "9" then
select_jyjt = "selected"
else
select_jyjt = ""
end if

dim select_zzsj
if request.form("lbxx") = "10" then
select_zzsj = "selected"
else
select_zzsj = ""
end if

dim select_emxz
if request.form("lbxx") = "11" then
select_emxz = "selected"
else
select_emxz = ""
end if

dim select_kyxx
if request.form("lbxx") = "12" then
select_kyxx = "selected"
else
select_kyxx = ""
end if

dim select_mstd
if request.form("lbxx") = "13" then
select_mstd = "selected"
else
select_mstd = ""
end if

dim select_mjct
if request.form("lbxx") = "14" then
select_mjct = "selected"
else
select_mjct = ""
end if

%>
<option value="4" <%=select_zhxw%>>综合新闻</option>
<option value="6" <%=select_dlxx%>>电脑信息</option>
<option value="5" <%=select_aqxx%>>爱情信息</option>
<option value="3" <%=select_lswh%>>历史文化</option>
<option value="7" <%=select_jkcs%>>健康常识</option>
<option value="1" <%=select_tlxx%>>铁路信息</option>
<option value="2" <%=select_zrkx%>>自然科学</option>
<option value="8" <%=select_cjxx%>>财经信息</option>
<option value="9" <%=select_jyjt%>>教育讲坛</option>
<option value="10" <%=select_zzsj%>>www世界</option>
<option value="11" <%=select_emxz%>>www学子</option>
<option value="12" <%=select_kyxx%>>考研信息</option>
<option value="13" <%=select_mstd%>>美食天地</option>
<option value="14" <%=select_mjct%>>民间传统</option>
<%
end if
if request.form("cxlb") = "2" then

if request.form("lbxx") = "1" then
s_cfrq = "selected"
else
s_cfrq = ""
end if

if request.form("lbxx") = "2" then
s_cfdd = "selected"
else
s_cfdd = ""
end if

if request.form("lbxx") = "3" then
s_dddd = "selected"
else
s_dddd = ""
end if

if request.form("lbxx") = "4" then
s_rjxx = "selected"
else
s_rjxx = ""
end if
%>
<option value="1" <%=s_cfrq%>>出发日期</option>
<option value="2" <%=s_cfdd%>>出发地点</option>
<option value="3" <%=s_dddd%>>到达地点</option>
<option value="4" <%=s_rjxx%>>日记信息</option>
<%
end if
if request.form("cxlb") = "3" then

if request.form("lbxx") = "1" then
s_gsyhzd = "selected"
else
s_gsyhzd = ""
end if

if request.form("lbxx") = "2" then
s_yhjxzh = "selected"
else
s_yhjxzh = ""
end if

if request.form("lbxx") = "3" then
s_jhjzzhgz = "selected"
else
s_jhjzzhgz = ""
end if

if request.form("lbxx") = "5" then
s_ghjtsgz2 = "selected"
else
s_ghjtsgz2 = ""
end if

if request.form("lbxx") = "6" then
s_jhjzzhgzk = "selected"
else
s_jhjzzhgzk = ""
end if

if request.form("lbxx") = "7" then
s_ghjtsgz1 = "selected"
else
s_ghjtsgz1 = ""
end if

if request.form("lbxx") = "8" then
s_lhemzh = "selected"
else
s_lhemzh = ""
end if

if request.form("lbxx") = "9" then
s_zsyhsyzh = "selected"
else
s_zsyhsyzh = ""
end if

if request.form("lbxx") = "10" then
s_dwjj = "selected"
else
s_dwjj = ""
end if

if request.form("lbxx") = "11" then
s_zj = "selected"
else
s_zj = ""
end if

if request.form("lbxx") = "12" then
s_yhdqcd = "selected"
else
s_yhdqcd = ""
end if

if request.form("lbxx") = "13" then
s_ghlhzhgpk = "selected"
else
s_ghlhzhgpk = ""
end if

if request.form("lbxx") = "18" then
s_ghlhzhgp = "selected"
else
s_ghlhzhgp = ""
end if
%>
<option value="1" <%=s_gsyhzd%>>工行站东所(1111)</option>
<option value="2" <%=s_yhjxzh%>>农行锦1支行(111)</option>
<option value="3" <%=s_jhjzzhgz%>>建行111支行(工资)</option>
<option value="5" <%=s_ghjtsgz2%>>工行1111所(工资2)</option>
<option value="6" <%=s_jhjzzhgzk%>>建行1111支行(工资卡)</option>
<option value="7" <%=s_ghjtsgz1%>>工行sss所(工资1)</option>
<option value="8" <%=s_lhemzh%>>农行峨眉支行(sss)</option>
<option value="9" <%=s_zsyhsyzh%>>招行ssss支行(工资卡)</option>
<option value="10" <%=s_dwjj%>>单位奖金(工资)</option>
<option value="11" <%=s_zj%>>sss(ssss)</option>
<option value="12" <%=s_yhdqcd%>>银行定期存单</option>
<option value="13" <%=s_ghlhzhgpk%>>工行ssss支行(ss)</option>
<option value="18" <%=s_ghlhzhgp%>>工行sss支行(ss)</option>
<%
end if
%>
</select>
</td></tr>
<tr>
<td align="center" width="108" height="28">
<p align="center"><font color="#008000" size="3"><b>查询范围</b></font></p></td>
<td align="center" width="108" height="28">
<p align="left">
<%
if request.form("cxlb") = "1" then

if request.form("cxxl") = "1" then
s_btss = "selected"
else
s_btss = ""
end if

if request.form("cxxl") = "2" then
s_lrss = "selected"
else
s_lrss = ""
end if

if request.form("cxxl") = "3" then
s_xxrq = "selected"
else
s_xxrq = ""
end if
%>
<select name="cxxl" onChange="javascript:document.getElementById('formcx').submit();">
<option value="99">所有信息</option>
<option value="1" <%=s_btss%>>标题搜索</option>
<option value="2" <%=s_lrss%>>内容搜索</option>
<option value="3" <%=s_xxrq%>>信息日期</option>
</select>
<%
end if
if request.form("cxlb") = "3" then

if request.form("cxxl") = "1" then
s_jyrq = "selected"
else
s_jyrq = ""
end if

if request.form("cxxl") = "2" then
s_ckjez = "selected"
else
s_ckjez = ""
end if

if request.form("cxxl") = "3" then
s_qkjez = "selected"
else
s_qkjez = ""
end if
%>
<select name="cxxl" onChange="javascript:document.getElementById('formcx').submit();">
<option value="99">所有信息</option>
<option value="1" <%=s_jyrq%>>交易日期</option>
<option value="2" <%=s_ckjez%>>存款金额(总)</option>
<option value="3" <%=s_qkjez%>>取款金额(总)</option>
</select>
<%
end if
if request.form("cxlb") = "2" or request.form("cxlb") = "99" then
%>
<font color="#008000" size="3"><b>精确查询</b></font>
<%
end if
%>
<%
dl_cxlb = request.form("cxlb")
dl_lbxx = request.form("lbxx")
dl_cxxl = request.form("cxxl")
if dl_cxxl = "" then
dl_cxxl = "99"
end if
%>
</p></td></form>
<form name=form2 action=searchdate.asp?dl_cxlb=<%=dl_cxlb%>&dl_lbxx=<%=dl_lbxx%>&dl_cxxl=<%=dl_cxxl%> method=post>
<td align="center" width="108" height="28">
<p align="center"><font color="#008000" size="3"><b>搜索内容</b></font></p>
</td>
<td align="center" width="176" height="28">
<p align="left">
<input type="text" name="keyword" maxlength="50">
</p></td></tr>
<tr>
<td align="center" width="526" height="28" colspan="4">
<font size="3" color="#008000">日期格式:2008-8-18</font>
</td></tr>
<tr>
<td align="center" width="526" height="28" colspan="4">
<input type="submit" value="查 询" style="color: #008000" action=searchdate.asp>     
<input type="reset" value="重 置" style="color: #008000">
</td></tr></form>
<tr>
<td align="center" width="526" height="28" colspan="4"> </td></tr>
<tr>
<td align="center" width="526" height="28" colspan="4">
<b><font size="3" face="华文行楷"><a href="./usermanager.asp">返回管理页</a></font></b>
</td></tr>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式