如何控制获得form表单弹出新窗口

来源:互联网 发布:如何数据采样分析 编辑:程序博客网 时间:2024/05/16 15:49

先用 window.open 打开一个你期望样式的窗口,然后将表单提交到这个窗口中。

利用 form 的 target 属性。
form的target属性指定为弹出窗口的名称即可,示例中弹出窗口名称为‘myWin’ 

================================================================ 

<script language="javascript"> 
function btClick() 

window.open('test.asp','myWin','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=300');
form1.action="test.asp" 
form1.submit(); 

</script> 
</head> 

<form name="form1" id="form1" method="post" target="myWin"> 
<input type="text" name="a" /> 
<input name="button" type="button" id="button" value="提交到弹出窗口" onclick="btClick()" /> 
</form>