子父窗口问题,实在没分了,各位对不住,以后一有分就散!
父文件: father.asp
<script language="javascript">
<!--
function openChild(){
var k = window.showModalDialog("child.asp",window,"dialogWidth:300px;status:no;dialogHeight:300px");
if(k != null)
document.getElementById("username").value = k;
}
//-->
</script>
<table>
<tr>
<td width="160"><input name="username" type="text" class="box" id="username"></td>
<td width="58"><img src="images/operurl.jpg" width="23" height="23" id="Image1" onMouseOver="MM_swapImage('Image1','','images/operurl2.jpg',1)" onMouseOut="MM_swapImgRestore()" onClick="openChild()"></td>
</tr>
</table>
子文件: child.asp
<!--#include file="ly_zsgl_conn.asp"-->
<HTML>
<HEAD>
<TITLE>人员档案</TITLE>
<script language=javascript>
<!--
var k=window.dialogArguments;
//设置父窗口的值
function setFather()
{
k.document.getElementById("username").value = document.getElementById("username").value;
window.close();
}
//设置返回到父窗口的值
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></HEAD>
<BODY>
<table width="90%" align="center" cellpadding="3" cellspacing="1" class="font9pt">
<%
set rs=server.CreateObject("adodb.recordset")
sql = "select * from ly_username"
set rs = conn.execute(sql)
if rs.eof and rs.bof then
response.write "对不起,没有任何人员档案."
response.end
else%>
<%do while not rs.eof%>
<tr>
<td width="20"><div align="center"><%=rs("id")%></div></td>
<td><input type="checkbox" name="usernmae" id="username" value="<%=rs("username")%>" onClick="setFather()"><%=rs("username")%></td>
</tr>
<%
rs.movenext
loop
rs.close
end if
%>
</table>
</BODY>
</HTML>
你弹出子窗口以后
子窗口以以下数据:
1 张三
2 李四
3 王五
我想选"李四或王五"返回父窗口,可总返回的都是"张三"
各位高手大哥大姐,帮忙解决,分多,只求问题解决!
多谢!