PS: The datas are already displaying on browser
The only problem is I'm not fetching the data when opening the modal and I want to edit the current info into new info using the modal
I think the problem is when every time i am closing the table row 'cause the table is designed vertically
this is the javascipt
<script >
$(document).ready(function(){
$('.editbtn').on('click', function(){
$('#myModal').modal('show');
$tr = $(this).closest('tr');
var data = $tr.children('th').map(function(){
return $(this).text();
}).get();
console.log(data);
$('#update_id').val(data[0]);
$('#first_name').val(data[1]);
$('#last_name').val(data[2]);
$('#email_address').val(data[4]);
$('#contact_number').val(data[5]);
$('#home_address').val(data[6]);
});
});
</script>