我做了一个公共地址簿,有查询功能,从查询结果选择主送人和抄送人,现在完成主送人和抄送人的选择,但是因为抄送人是不同单位的人员,需要重新查询单位找到相关人员,但是一查询就把原来选好的人员也刷新了,我希望只是在左边表格里显示查询结果,无论查询多少次都不影响右边两个表格的数据。
代码如下:
有人说用<iframe>,我试了并不成功,请大家帮帮忙,谢谢。
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
selectusers = trim(request("SelectedUsers"))
if left(selectusers,"1")="," then selectusers=right(selectusers,len(selectusers)-1)
arrSelectUsers=split(selectusers,",")
dim strSelectUsers
if not isempty(arrSelectUsers) then
for i=ubound(arrSelectUsers) to 0 step -1
str=GetUser1("tblUser","UserName",arrSelectUsers(i))
strSelectUsers=strSelectUsers &","& str
next
if left(strSelectUsers,"1")="," then strSelectUsers=right(strSelectUsers,len(strSelectUsers)-1)
end if
selectusers1 = trim(request("SelectedUsers1"))
if left(selectusers1,"1")="," then selectusers1=right(selectusers1,len(selectusers1)-1)
arrSelectUsers1=split(selectusers1,",")
dim strSelectUsers1
if not isempty(arrSelectUsers1) then
for i=ubound(arrSelectUsers1) to 0 step -1
str=GetUser1("tblUser","UserName",arrSelectUsers1(i))
strSelectUsers1=strSelectUsers1 &","& str
next
if left(strSelectUsers1,"1")="," then strSelectUsers1=right(strSelectUsers1,len(strSelectUsers1)-1)
end if
%>
<%
Dim sql,rsb
set rsb=server.CreateObject ("ADODB.Recordset")
sql = "select ID,enterarea_id,department from tbldepartment where disp='0' order by enterarea_id"
rsb.Open sql,oConn,1,3
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rsb.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rsb(2))%>","<%= trim(rsb(1))%>","<%= trim(rsb(2))%>");
<%
count = count + 1
rsb.movenext
loop
rsb.close
set rsb=nothing
%>
onecount=<%=count%>;
function changeunits(enter_area)
{
document.Queryform.selDept.length = 0;
var enter_area=enter_area;
var i;
document.Queryform.selDept.options[0] = new Option('请选择','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == enter_area)
{
document.Queryform.selDept.options[document.Queryform.selDept.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%
strEnterarea = trim(request("selEnterarea"))
strDept = trim(request("selDept"))
sqlCondition=""
if strEnterarea <>"" then sqlcondition=sqlCondition&"d.enterarea_id='"&strEnterarea&"' and "
if strDept<>"" then sqlCondition=sqlCondition&"d.department='"&strDept&"' and "
if sqlcondition<>"" then
strCondition=sqlcondition & "s.disp='0' order by e.id,d.id"
else
strCondition="s.disp='0' order by e.id,d.id"
end if
set rsm=Server.CreateObject("Adodb.Recordset")
sql="select e.id as enter_area,e.enter_area,d.id as dept_id,d.enterarea_id,d.department as dept,s.id as user_id,s.loginname,s.username,s.department "
sql=sql&"from "
sql=sql&"tbl_enterarea as e "
sql=sql&"left join "
sql=sql&"tbldepartment as d "