3
I do this by manipulating the DOM, through custom attributes, like data-id="id-do-teu-registro"
<tr data-id='2'>
....
</tr>
In Javascript, I create a function, in which I will make a request via ajax for a php function that will return me the data of the company in json, at the moment I click on the line
$('tabela>tr').on('click',function(){
var id = $(this).data('id');
$.ajax({
url:url-de-requisicao.php
type:'post',
dataType:'json',
data:{id:id},
success:function(data){
$('input#nome').val(data.empresa)
$('input#endereco').val(data.empresa)
$('#modal-empresa').modal('open');
};
});
});
In this example I am receiving 'data', which are the objects coming from the requested url, and populate the modal form fields.
$.modal()
It’s a bootstrap library.
I hope I’ve made that kind of problem clearer.