帮我改一下这段代码吧:<每次选择之后都跳到第一个部门,导致第一个部门的内容不能显示>
<!--#include file="conn.asp"-->
<script language="javascript">
function changeItem()
{
var depart_name=staff_depart.depart.value;
window.location.href="personnel_wage.asp?depart_name="+depart_name;
}
</script>
<form name="staff_depart">
<p align="center">
部门:
<select name="depart" id="select" onchange="changeItem()">
<% '从department表中查询出部门名称,将其加到department下拉菜单中
set rs_dpt=server.CreateObject("adodb.recordset")
sqlstr="select depart_name from department"
rs_dpt.open sqlstr,conn,1,3
%>
<%while not rs_dpt.eof
temp=rs_dpt("depart_name")
if temp<>"" then
%>
<option value="<%=temp%>" <%if temp=request.querystring("depart_name") then Response.Write "selected" %>><%=temp%></option>
<%
end if
rs_dpt.movenext
wend
%>
</select>
员工姓名:
<select name="staff_name">
<% '从staff表中查询出相应部门的所有员工的姓名,并将其加到staff_name下拉菜单中
depart_name=request.querystring("depart_name")
set rs_name=server.CreateObject("adodb.recordset")
sqlstr="select staff_name,staff_num from staff where depart_name='"&depart_name&"'"
rs_name.open sqlstr,conn,1,3
%>
<%while not rs_name.eof
temp=rs_name("staff_name")
if temp<>"" then
%>
<option value="<%=temp%>"><%=temp%></option>
<%
end if
rs_name.movenext
wend
rs_name.close
set rs_name=nothing
%>
<input type="submit" name="Submit" value="查询">
</form>