javascript: submit form in an iframe…help

限于喜欢 提交于 2019-12-11 16:24:23

问题


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


回答1:


Not sure if this helps but I've used a hidden iframe for uploads before.




回答2:


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 ;)



来源:https://stackoverflow.com/questions/1478525/javascript-submit-form-in-an-iframe-help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!