问题
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