javascript:在iframe中提交表单...帮助 [英] javascript: submit form in an iframe...help

查看:264
本文介绍了javascript:在iframe中提交表单...帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下是我的情况:我使用了2个jQuery插件。 Shadowbox和验证(bassistance)。



我点击一个链接注册一个简报。该链接在shadowbox中打开一个表单。没什么大不了的。表单经过插件验证。



当表单经过验证并准备提交时,它不会。



  submitHandler:function(form){$}这是我submitHandler选项(在validate插件中)的样子。 b 
$ b form.submit();

var s = window.parent.Shadowbox;
s.open({
player:'iframe',
title:'Thank you!',
content:'http://www.somesite.com/includes/ thank_you_grid_3.php',
width:270,
height:110
});
}

帮助:)

<如果你的表单有一个名字为'submit'的提交按钮,那么它将不会以编程方式提交。

。那么,至少在某些浏览器中。

谁知道为什么?...请评论;)


I can't believe I've never done this before....

Here's my situation: I am using 2 jQuery plugins. Shadowbox and validate (bassistance).

I click on a link to sign up for a newsletter. The link opens a form in a shadowbox. No biggie. The form is validated with the plugin.

When the form is validated and ready to submit, it doesn't.

This is what my submitHandler option (in the validate plugin) looks like:

submitHandler: function(form) {

form.submit();

var s = window.parent.Shadowbox;
s.open({
player:     'iframe',
title:      'Thank you!',
content:    'http://www.somesite.com/includes/thank_you_grid_3.php',
width:      270,
height:     110
});
}

Help :)

Thanks

解决方案

If your form has a submit button with name of 'submit' as well, it won't submit programmatically. Well, at least in some browsers.

Who knows why?.. Comment please ;)

这篇关于javascript:在iframe中提交表单...帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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