I want to send several input values that have the same name through a POST with Ajax. I do not know if you let me understand, but what I want is to create a detail of purchases.
My form is as follows:
<form class="form-horizontal" role="form">
<input type="date" class="form-control" id="facordada_add">
<input type="date" class="form-control" id="facordada_add">
<input type="date" class="form-control" id="facordada_add">
</form>
My Script:
$(document).on('click', '.add-modal', function() {
$('#addModal').modal('show');
});
$('.modal-footer').on('click', '.add', function() {
$.ajax({
type: 'POST',
url: 'gestion-pedidos',
data:{
'data': $("modal-footer").serialize(),
'_token': $('input[name=_token]').val(),
},
success: function(data) {
},
error: function(data) {
},
});
});