var myID=document.frames["frame的name"].document.getElementById('文本框的id')

解决方案 »

  1.   

    楼上的正确,这里有篇框架内的调用,对你可能有用 http://www.fzic.net/SrcShow.asp?Src_ID=158
      

  2.   

    opener.document.getElementById('文本框的id')
      

  3.   

    是这样吗?
    father.html
    -----------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    [code=JScript]<script type="text/javascript">
    var oWin=null;
    function OpenWindow(){
    oWin=window.open("child.html",'_blank',"width=100 height=200");
    }

    function GetValue(){
    if(oWin){
    alert(oWin.document.getElementById('txtInput').value);
    }
    else
    alert("窗口还没有打开!");
    }
    </script></head>
    <body><form id="form1" name="form1" method="post" action="">
      <label>
      <input type="button" name="btnOpen" id="btnOpen" value="打开窗口" onclick="OpenWindow()"/>
      </label>
      <label>
    <input type="button" name="btnGet" id="btnGet" value="获取值" onclick="GetValue()"/>
    </label>
    </form>
    </body>
    </html>[/code]child.html
    ---------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
    <form id="form1" name="form1" method="post" action="">
      <label>
      子文本框
      <input name="txtInput" type="text" id="txtInput" value="123" />
      </label>
    </form>
    </body>
    </html>
      

  4.   

    opener.document.getElementById("id").value
      

  5.   


    function   openprint()   //打印 
    {     
    var   myID   =这opener.document.getElementById("txtInput").value
    //.............
    }
      

  6.   

    谢谢大家,
    父窗口打开的是一个DIV做的模拟窗口,模拟窗口包含<IFRAME id=winrp style="WIDTH: 160px; HEIGHT: 155px" name=winrp_content src="cc.htm" frameBorder=0> </IFRAME>
    现在就是如何取得CC.htm中的一个文本框的值
      

  7.   

    window.winrp_content.document.all.txtID.value
      

  8.   

    是这样啊.那你应该首先获得div中窗口对象的引用(你最好将iframe的id和name都写上否则ff可能不行)
    window.frames["winrp"].document.getElementById("文本框id").value由于不能测试所以不能保证它的正确性你调试一下吧