Is to possible to submit two forms simultaneously with either javascript or a submit button?
Form structure is ok something like this:
<form name="form1" method="post">
.........
</form>
<form name="form2" method="post">
.........
</form>
And get the data from the two in a array?
No, this is not possible. You can create a third hidden form, that will serialize fields from both of them.
If you can use jQuery:
var str1 = $("form1").serialize();
var str2 = $("form2").serialize();
$.post(url, str1 + "&" + str2);
You need to make sure that str1 and str2 aren't empty and of course avoid name conflicts between the two forms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With