0
I have the following table:
<table id="tabela">
<thead>
<tr>
<th>Produto</th>
<th>Cliente</th>
</tr>
</thead>
<tbody>
<tr>
<td id="produto1"><a href="" data-toggle="modal" data-target="#myModal">Banana</a></td>
<td id="cliente1"><a href="" data-toggle="modal" data-target="#myModal">José da Silva</a></td>
</tr>
</tbody>
</table>
As you can see, in the table I have 2 links on the same line, one link should show through a modal the product data and the other shows the customer data. To show the product modal I used the following Jquery script:
$(document).on("click","#tabela td a",function(e){
e.preventDefault()
var idproduto= $(this).parent().attr("id");
$('.modal-body').load('dados_produto.php?id='+idproduto);
});
So far everything works perfectly, my problem is: how to create a new interaction with Jquery for the client link to open a modal to display the 'data_client.php file? id=+idclient'?
At this link contains a very similar response to what you need.
– Jorge.M
Wow... I couldn’t funfar through the recommended post
– Rafael Christófano