I have a table with automatically generated links and values being passed via json.
The link returns the correct values being generated using PHP.
<li>
<a href='phpProcess/showFormDelegationPr.php?prId="+item.pr_id+"' class='link-form-delegation' id='show-form-delegation'>
<i class='fa fa-user'></i> Delegar
</a>
</li>
I want to pass values to PHP using jquery, but I'm not succeeding.
I tried the following code:
$("#consult").on("click", ".link-form-delegation", function(e){
e.preventDefault();
$.ajax({
url: $("#show-form-delegation").attr("href"),
type: 'GET',
success: function(data){
alert(data);
}
});
});
The problem is that for all rows in the table the alert always shows the return value of the first row of the table.