表单对象可以直接这样调用
mainFrame.fromname.inputname.value脚本函数就不知道能不能调用了。没试过

解决方案 »

  1.   

    都可以调用表单对象是document对象
    脚本是window对象
      

  2.   

    FRM_0.htm
    -------------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>外框架</title></head><frameset rows="*,80" frameborder="NO" border="0" framespacing="0">
      <frame src="FRM_1.htm" name="mainFrame">
      <frame src="htm_0.htm" name="bottomFrame" scrolling="NO" noresize>
    </frameset>
    <noframes><body></body></noframes>
    </html>FRM_1.htm
    ------------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>内框架</title></head><frameset rows="80,*" cols="*" frameborder="NO" border="0" framespacing="0">
      <frame src="htm_top.htm" name="topFrame" scrolling="NO" noresize >
      <frameset rows="*" cols="147,*" framespacing="0" frameborder="NO" border="0">
        <frame src="htm_left.htm" name="leftFrame" scrolling="NO" noresize>
        <frame src="htm_main.htm" name="htm_mainFrame">
      </frameset>
    </frameset>
    <noframes><body></body></noframes>
    </html>htm_main.htm
    ---------------------
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script language="javascript">
    function htm_main()
    {
    alert('test_main');
    }
    </script>
    </head><body>
    <p>htm_main.htm</p>
    <form id="form1" name="form1" method="post" action="">
      <input name="text1" type="text" id="text1" value="text1text1" />
    </form>
    <p>&nbsp;</p>
    </body>
    </html>
    htm_0.htm
    ---------------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>外框架</title>
    <script language="javascript">
    function htm_0()
    {
    alert(parent.frames('mainFrame').frames('htm_mainFrame').form1.text1.value);
    window.parent.mainFrame.htm_mainFrame.htm_main();
    }
    </script>
    </head>
    <body>
    htm_0.htm
    <input type="button" name="Submit" value="按钮" onClick="htm_0()">
    </body></html>