日期:2014-05-20  浏览次数:20554 次

谢谢回答!
当父窗口的文本框获取焦点是弹出子窗口,在子窗口中选择数据后,子窗口关闭,父窗口的文本框得到子窗口中选择的数据

------解决方案--------------------
a.htm
======================================================
<input type= "text " id= "parenttext " onfocus= "show() ">
<script type= "text/javascript ">
function show(){
window.open( "b.htm ");
}
</script>

b.htm
========================================================
<input type= "text " id= "childtext ">
<input type= "button " value= "点一下 " onclick= "setparent() ">
<script type= "text/javascript ">
function setparent(){
opener.document.getElementById( "parenttext ").value=document.getElementById( "childtext ").value;
window.close();
}
</script>
------解决方案--------------------
楼上对