将表单提交到弹出窗口?

问题描述:

我有一个脚本将表单提交到弹出窗口但不显示表单的操作(process.php),它不显示任何内容(空白窗口)。继承我的剧本:

I have a script that submits a form to a popup window but instead of displaying the form's action (process.php), it displays nothing (blank window). Heres my script:

function redirectOutput() {
var myForm = document.getElementById('formID');
var w = window.open('about:blank','Popup_Window','toolbar=0,scrollbars=0,location=0,statusb
ar=0,menubar=0,resizable=0,width=400,height=300,left = 312,top = 234');
myForm.target = 'Popup_Window';
return true;
}


它有效,但你有你的 window.open 突然出现换行符。

It works, but you have a newline suddenly in your window.open.

这对我来说很合适: http://jsfiddle.net/pimvdb/N3YSG/ 。

var myForm = document.getElementById('formID');
myForm.onsubmit = function() {
    var w = window.open('about:blank','Popup_Window','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300,left = 312,top = 234');
    this.target = 'Popup_Window';
};