I have a table that loads me rows and each row has to show me a modal with a detail of the record of the row, it works correctly with the first row, but the other rows do not show me the modal
code:
<tr id="pedidoDetalle">
<td><?=$r["producto"]." "?><a href="#" id="detoxDet" id_detox="<?php echo $r['id_detox'] ?>" detox="<?php echo $r['idetox']; ?>" ><?php echo $verdetalle; ?></a></td>
<td><?=$r["total"];?></td>
<td><?=$r["cantidad"];?></td>
<td><?=number_format($r["total"] * $r["cantidad"],2);?></td>
java modal script:
<script>
$(document).ready(function(){
$('#detoxDet').click(function(){
var id = $(this).attr("detox");
var id_detox = $(this).attr("id_detox");
$.ajax({
url:"detalleDetox.php",
method:"post",
data:{id:id,id_detox:id_detox},
success:function(data){
$('#detalle_detox1').html(data);
$('#detalle_detox').modal("show");
}
});
});
});
</script>
pdt: I think the problem is because the rows point to the same modal, in this case as I could do it please, regards