如果要返回到父窗口的 某个 设置了 ID 的 <div> 中 可以这样 
在子窗口 onclick="close()" close() 之前加上 window.opener.document.getElementById('父窗体中某个 div 的 ID').innerHTML = document.getElementById('子窗体中某个 标签').value;

解决方案 »

  1.   

    CNCPT01 能否直接在代码上修改谢谢
      

  2.   

    fu.html
    <!----加个id---->
    <input   style="WIDTH:   127px"   name=PolicyId  id="PolicyId" >zi.html<!-----以后标签写规范点,什么能嵌套,什么不能---->
    <table   width="100%"   border="0"   align="center"   cellpadding="0"   cellspacing="1"> 
        <tr> 
            <td   width="18%"   class="bgc_td_c"><a   href="fu.html?bdid=100100"   onclick="window.opener.document.getElementById('PolicyId').value=this.innerHTML;self.close();" style="color:red"> 编号为100100的记录  </a>  </td> 
            
        </tr>       
    </table> 
      

  3.   

    showbo 谢谢你的指点,但是关闭不了子窗口
      

  4.   

    我只想把子窗口记录bdid传到父窗口,而不是把子窗口点击内容传到父窗口.等待高手给解决
      

  5.   

    你把你记录内容前放个隐藏控件<input id="_hidBdid" type=hidden value="100100">
    然后在父页面放一个接收该值的控件比如:<input  type="text" id="ctrlid">
    修改如下:
    <script language=javascript>
      function doPastValue(){
         var pastvalue = document.getElementById("_hidBdid").value;
         window.opener.document.getElementById('ctrlid').value = pastvalue;
         window.close();
      }
    </script><table   width="100%"   border="0"   align="center"   cellpadding="0"   cellspacing="1"> 
        <tr> 
           <td width="18%" class="bgc_td_c">
             <a href="javascript:doPastValue()" style="color:red"> 编号为100100的记录  </a>
          </td> 
            
        </tr>       
    </table> 
      

  6.   

    好,通过测试先不结贴看还有其他方面没有
    特别谢谢xiuxiaopeng 分到结贴时给你!
      

  7.   

    这几天在忙其他事情,在看代码发现有写问题,请高手指正
    xiuxiaopeng 给出的代码可以实现单条记录传值,如果子窗口有多条可以选择的记录改怎么写代码<table   width="100%"   border="0"   align="center"   cellpadding="0"   cellspacing="1">   
         <tr>   
            <td width="18%" class="bgc_td_c"> 编号为100100的记录 </td>  
             
         </tr>    
         <tr>   
            <td width="18%" class="bgc_td_c"> 编号为100100100的记录 </td>  
             
         </tr>      
    </table>