I need to take this button value:
<button type="button" class="btn btn-outline-primary view_data2" id=" <?php echo $row['idFuncionarios']; ?>" value = "<?php echo $row['dia']; ?>" name = "envio">Ver</button></td>
And send it ($row['dia']) to the backend via POST method.
I already have this ajax function, which takes the button id and sends it to the same url I want using POST!
$('.view_data2').click(function() {
var employee_id2 = $(this).attr("id");
$.ajax({
url: "includes/accomUser.inc.php",
method: "post",
data: {
employee_id2: employee_id2
},
success: function(data) {
$('#employee_detail2').html(data);
$('#adddata2').modal("show");
}
});
$('#addmodal2').modal("show");
});
});
How can I do that?
Thank you!