将表单提交到弹出窗口? [英] Submit form to popup window?

查看:116
本文介绍了将表单提交到弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本将表单提交到弹出窗口但不显示表单的操作(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';
};

这篇关于将表单提交到弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆