怎样实现两个下拉框的联动?高手能帮我改一下代码吗?
下面是我的ASP文件里的代码,现在两个下拉框都是独立的,第一个下拉框的内容是学院,第二个是专业,如何才能实现联动呢??高手能帮忙改一下代码吗?<formid="form1...
下面是我的ASP文件里的代码,现在两个下拉框都是独立的,第一个下拉框的内容是学院,第二个是专业,如何才能实现联动呢??高手能帮忙改一下代码吗?
<form id="form1" name="form1" method="post" action="">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"> <span class="style3"> 添加班级</span></td>
</tr>
<tr>
<td align="center">请选择学院</td>
<td colspan="2" align="left"><select name="xueyuan" size="1">
<option value="">请选择学院</option>
<%
sql1="select * from xueyuan order by id desc"
dim rs1
set rs1=conn.execute(sql1)
if not rs1.EOF then
while not rs1.EOF
%>
<option value="<%=rs1("xueyuan")%>"><%=rs1("xueyuan")%></option>
<%
rs1.MoveNext
wend
else
Response.Write "<option value=''>目前还没有</option>"
end if
rs1.close
set rs1=nothing
%>
</select> </td>
</tr>
<tr>
<td align="center">请选择专业</td>
<td colspan="2" align="left"><select name="zhuanye" size="1">
<option value="">请选择专业</option>
<% sql="select * from zhuanye order by id desc"
dim rs
set rs=conn.execute(sql)
if not rs.EOF then
while not rs.EOF
%>
<option value="<%=rs("zhuanye")%>"><%=rs("zhuanye")%></option>
<%
rs.MoveNext
wend
else
Response.Write "<option value=''>目前还没有</option>"
end if
rs.close
set rs=nothing
%>
</select> </td>
</tr>
<tr> 展开
<form id="form1" name="form1" method="post" action="">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"> <span class="style3"> 添加班级</span></td>
</tr>
<tr>
<td align="center">请选择学院</td>
<td colspan="2" align="left"><select name="xueyuan" size="1">
<option value="">请选择学院</option>
<%
sql1="select * from xueyuan order by id desc"
dim rs1
set rs1=conn.execute(sql1)
if not rs1.EOF then
while not rs1.EOF
%>
<option value="<%=rs1("xueyuan")%>"><%=rs1("xueyuan")%></option>
<%
rs1.MoveNext
wend
else
Response.Write "<option value=''>目前还没有</option>"
end if
rs1.close
set rs1=nothing
%>
</select> </td>
</tr>
<tr>
<td align="center">请选择专业</td>
<td colspan="2" align="left"><select name="zhuanye" size="1">
<option value="">请选择专业</option>
<% sql="select * from zhuanye order by id desc"
dim rs
set rs=conn.execute(sql)
if not rs.EOF then
while not rs.EOF
%>
<option value="<%=rs("zhuanye")%>"><%=rs("zhuanye")%></option>
<%
rs.MoveNext
wend
else
Response.Write "<option value=''>目前还没有</option>"
end if
rs.close
set rs=nothing
%>
</select> </td>
</tr>
<tr> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询