子窗口向父窗口传值

父窗口

 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4.     <title>无标题页</title>
  5.     <script type="text/javascript">
  6.     function openWindow() {
  7.           window.showModelessDialog("child.htm", document.getElementById('txtName') ," dialogWidth='40px';dialogHeight='167px'dialogLeft=610;dialogTop=256;resizable='no';status='no';scroll='no'"); 
  8.     }  
  9. </script>
  10. </head>
  11. <body>
  12.     <input type="text" id="txtName" />
  13.     <a href="#" onclick="openWindow()">选择</a>
  14. </body>
  15. </html>

子窗口

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4.     <title>无标题页</title>
  5.     <script type="text/javascript">
  6.       function getValue() {
  7.           window.dialogArguments.value=document.all("Select1").value;
  8.                 window.close();
  9.        }
  10. </script>
  11. </head>
  12. <body>
  13.     <select id="Select1">
  14.         <option value="1"></option>
  15.         <option value="2"></option>
  16.     </select>
  17.     <input id="btnSelect" type="button" value="选  择"  onclick="getValue()" />
  18. </body>
  19. </html>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值