Afternoon all,
I have the following code which works fine, apart from i need to send the variable itemID to my php script as $_POST['deleteClientID']. Now i know that data: itemID, is wrong but i'm unsure what it should be?
function deleteItem(item){
if (confirm("Do you wish to delete this item?")) {
//alert(item);
var parent = item.closest('.row');
var itemID = item.data('client-id');
$.ajax({
type: 'POST',
url: 'includes/delete_client.php',
data: itemID,
cache: false,
beforeSend: function() {
alert(itemID);
parent.switchClass("", "redBG", 300, "easeInOutQuad");
},
success: function() {
parent.slideUp(500,function() {
parent.remove();
});
}
});
}
return false;
}