分两种情况:
1。你的表单数据很短,完全可以通过get方式传送过去,那么,你可以这样写:<html>
<head>
<script language="JavaScript">
<!--
function abc(theform){
window.open(theform.action + "?t1=" + theform.t1.value + "&t2=" + theform.t2.value, "", "");
return false;
}
//-->
</script>
</head><body>
<form method=post action="test.asp" onsubmit="return abc(this)">
<input type="text" name="t1">
<input type="text" name="t2">
<input type="submit" value="submit">
</form>
</body>
</html>
2。你的表单数据可能很复杂,很多,那可以直接改变form的action,使弹出新窗口
<form target=_blank ...>,这种方法不足的地方就是没有了window.open那些可调的窗口参数,但如果你只是想简单的打开新窗口,这就够了3。第三种方法可以说是结合了前两种的优点。
该方法的原理是,在A页面中有一隐藏帧/iframe B, A页面提交表单就提交到B处理,然后再由B页面打开新窗口C,这时当然可以控制打开的属性。这种方法的限制是:复杂的数据最好交给B页面处理,而不是向前两种方法那样(它们没有B页面,直接交给C处理了),如果你的程序是写好了的,这种方法改起来可能比较烦。