Combine multiple forms and send everything in one request
Hi,
I have multiple forms on my page, and when the user submits I want to combine all forms into one "master form" / request that gets submitted to the server. Is that possible?
I have found that I can get all input with this code:
$('form').serialize();
But how do I send the serialized data as a POST request to the server?
$.ajax({
url: '/the/url/to/post/to',
dataType: 'json',
type: 'post', // send as POST
data: $('form').serialize(),
success: function (data) {
// do something with returned data, or not
},
});