webform中如何往iframe所指引的webform中传入参数,如何获取其返回值?

解决方案 »

  1.   

    <iframe src="xxx.aspx?id=xxx&no=GGGG"></iframe>
      

  2.   

    返回值可从IFRAME页面直接向父页面写入
    parent.document.all("xx").value = xxx;
    也可在父页面直接读取IFRAME页面中的值
    document.frames[0].document.all("xxx").value;
      

  3.   


    谢谢各位,web不熟悉再请问一下,如何在主webform中设置一个打印按钮,但是打印的是iframe的webform?
      

  4.   

    我做web怎么这么费劲好不容易才明白了一点点document的用法
      

  5.   

    <script language="javascript">function printFrame()
    {
    var pp = frames['ifrm'];
    //alert(pp.location.href);
    pp.focus();
    pp.print();
    }
    </script>
    <input type="button" name="someButton" value="打印" onclick="javascript:printFrame()" style="WIDTH: 88px; HEIGHT: 32px">或者
    <input type="button" name="someButton" value="打印1" onclick="ifrm.focus();ifrm.print();" style="WIDTH: 88px; HEIGHT: 32px">ifrm:我页面上的iframe
      

  6.   

    You can print the iframe in following way:<html>
    <script language="javascript">
    function PrintIFrame()
    {
    document.myiframe.focus(); 
    document.myiframe.print(); 
    }
    </script>

    <body>
    <iframe name="myiframe" id="myiframe" 
    src="content.htm"></iframe>
    <input type="button" value="Print" onClick="PrintIFrame
    ()">
    </body>
    </html>/////////////////////////////////////////////////////////////////////////////
    <frameset rows="50%,*">
    <frame src="page1.htm" name=page1>
    <frame src="page2.htm" name=page2>
    </frameset>If you want to print all pages in page1.htm,you can do  it  like this: parent.page2.focus()
    parent.page2.print()
    window.focus()
    window.print()

    It will print page1.htm and page2.htm
    //////////////////////////////////////////////////////////////////////function call_print()
    {
       window.parent.someframename.print();
    }                                         just call this function from a button's onclick....
    ///////////////////////////////////////////////////////////////////
    In NN4+ you just call
      frameReference.print()
    e.g.
      parent.frameName.print()
    For IE5 you have to set focus on the frame first so you need
      parent.frameName.focus();
      parent.frameName.print();
    <script language=JavaScript> function CheckIsIE() 

        if  (navigator.appName.toUpperCase() == 'MICROSOFT 
    INTERNET EXPLORER')  { return true;} 
        else { return false; } 
      } 
      function PrintThisPage() 
      {      if (CheckIsIE() == true) 
          { 
             document.ifWorkspace.focus(); 
             document.ifWorkspace.print(); 
          }      
          else 
           { 
              window.frames['ifWorkspace'].focus(); 
              window.frames['ifWorkspace'].print(); 
            }    } </script> In the parent window, just put a link or button to call the PrintThisPage() method: <a href="javascript:PrintThisPage();" >Print This Page</a>