ajax submit multiple forms of data:
Forms respectively different first serialize () function, then the data serialized by stitching + submitted to the background, the following specific examples
var data1 = $('#form1).serialize();
var data2 = $('#form2).serialize();
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: data1+data2,
success: function (result) {
},
error : function() {
}
});
Background Thinkphp5 receive data:
$data = input('post.','');