page页中parent.frames[1].document.controlform.hidden.value=x;-->parent.frames[1].document.controlform.hidden1.value=x;

解决方案 »

  1.   

    第一个
    <html>
    <head>
    <title>编写JAVA脚本</title>
    </head>
    <frameset cols="*,10" border="2">
     <frame name="inputfrm" src="page1.htm">
     <frame name="savadata" src="savadata.htm">
    </frameset>
    </html>                     savadata页
    <html>
    <head>
    <title>hidden对象savadata页</title>
    </head>
    <body>
    <form name="controlform" target="_top" action="www.test.com">
    <input name="hidden1" type="hidden">
    <input name="hidden2"  type="hidden">
    </form>
    </body>
    </html>
                        page1 页
    <html>
    <head>
    <title>hidden对象page1页</title>
    <script language="JavaScript">
    function savatohidden()
    {x=document.form1.name1.value;
     parent.savadata.document.controlform.hidden1.value=x;
     alert("信息已经保存到隐藏元素中");
     window.location="./page2.htm"
     }
    </script>
    </head>
    <body>
    <form name="form1" action="">
    姓名:<input name="name1" type="text"><p>
    <input type="button" value="继续" onClick="savatohidden()">
    </form>
    </body>
    </html>
                                page2页
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>hidden对象page2页</title>
    <script language="JavaScript">
    function savatohidden()
    {x=document.form2.email.value;
    parent.savadata.document.controlform.hidden2.value=x;
    alert("信息已经保存到隐藏元素中了");
    window.location="./page3.htm"
    }
    </script>
    </head>
    <body>
    <form name="form2" action="">
    邮箱地址:<input name="email" type="text"><P>
    <input type="button" value="继续" onClick="savatohidden()">
    </form>
    </body>
    </html>
                         page3页
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>hidden对象page3页</title>
    </head>
    <body>
    <center>
    <script language="JavaScript">
    document.write("<h2>你填写的信息如下:</h2><p>");
    document.write("姓名:"+parent.savadata.document.controlform.hidden1.value+"<p>")
    document.write("你的信箱地址:"+parent.savadata.document.controlform.hidden2.value+"<hr")
    document.write("单击发送按钮信息将提交给服务器<P>")
    </script>
    <form>
    <input type="button" value="完成" onClick="parent.frames[1].controlform.submit()">
    </form>
    </center>
    </body>
    </html>
      

  2.   

    frames[1]--->savadatapage2
    savetohidden()
    ------->
    savatohidden()