两个文件,test.htm 和 lizi.htm
++++=================== test.htm =========
<html>
<body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="button" value="打开新窗口" onclick="window.open('lizi.htm')">
</form>
</body>
</html>========== lizi.htm ===========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function test(){
opener.form1.textfield.value=document.form1.textfield.value
self.close();
}
</script>
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="button" name="Submit" value="提交" onclick="test()">
</form>
</body>
</html>
++++=================== test.htm =========
<html>
<body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="button" value="打开新窗口" onclick="window.open('lizi.htm')">
</form>
</body>
</html>========== lizi.htm ===========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function test(){
opener.form1.textfield.value=document.form1.textfield.value
self.close();
}
</script>
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="button" name="Submit" value="提交" onclick="test()">
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货