Forum Moderators: open
<form method="post" action="example.com/landing_page">
<input type="text" name="blah" value"blah">
<input type="submit">
</form>
When submitted I would like to post the form using Ajax... but after that happens I would like the form to be posted to the action defined in the form tag.
So basically it would get submitted twice.... Is this possible?
Any guide to this would be helpful.
Another approach, though not an option if the AJAX call must come first, is to 'target' the form to a, possibly hidden, iframe and have the two submissions run simultaneously and independant of each other (or the AJAX call can be delayed), by adding a 'onsubmit="someAjaxFunctionCallToSubmit(someReferenceToForm)"' to the 'form begin' tag.
<form method="post" action="example.com/landing_page" onsubmit="ajaxsubmit();">
function ajaxsubmit() {
.....ajax stuff here
return true;
}
This works in IE, but in FF the form data doesn't get passed with the Ajax submit but does get passed to the second "hard" submit. If I set the return to false the form data is passed to the Ajax submit.
function ajaxsubmit() {
.....ajax stuff here
return false;
}
But obviously I don't get the second submition.
Any guesses?
[edited by: Demaestro at 4:12 pm (utc) on Nov. 1, 2007]