I create a dynamic table from a database:
//[..]Typical code to fetch data from the database
//$exp_id comes from the database
<td><input = type = 'hidden' value = '".$exp_id."' id = 'exp_id'/><input type = 'button' id = 'alpha' value = 'a' onclick = $('.ui.small.modal').modal('show'); /></td>
I want to post the ID of an entry and get the results on a modal. The problem is that it takes only the ID from the first entry. When I test it with a single button and a single text box (I put the IDs manually - not from the database) it works without any problem Jquery:
$(document).ready(function(){
$('#alpha').click(function(){
id = $('#exp_id').val();
//alert(id);
$.post('find_expert.php',{exp1:id},function(res){
$(".content").html(res);
});
});
});
Any ideas please?