Possible Duplicate:
How pass variable in jquery easy confirm
Pass variable to click function jquery easy confirm
By using javascript confim i have done suspending. Now i want to turn this to jquery easy confirm how can i do this
My PHP Code ( this function is called in a loop ):
function prepareRow( $flag, $Id )
{
$rowResponse = '<tr>
<td style="width:12%"> ' . $Id . ' </td>
<td><a href="javascript:void(0);" id="suspend" ></a> </td>
</tr>';
return $rowResponse
}
Jquery easy confirm link: http://projectshadowlight.org/jquery-easy-confirm-dialog/
I have tried like this but if click on 'yes' i want pass '$id' to it. So that i can suspend row.
Please help me out
$("#suspend").easyconfirm({locale: {
title: 'Are you sure?',
text: 'Are you sure, you want to suspend?',
button: ['No',' Yes'],
closeText: 'Close'
}});
$("#suspend").click(function() {
$.post("suspend.php", { "Id" : Id },
function(data){
$.ajax({
type:"POST",
url: "prepareTable.php",
success: function(data){
$("#example").html(data);
}
});
});
});