Hello,
I am trying to confirm whether a user wants to perform a desired action using AJAX and am having trouble getting it to work.
I have this function:
I then use the function in this event:
The dialog box comes up, but if I click 'OK' or 'Cancel' nothing happens.
Any assistance on this matter would be greatly appreciated!
I am trying to confirm whether a user wants to perform a desired action using AJAX and am having trouble getting it to work.
I have this function:
Code:
function confirmPost() {
var agree = confirm("Are you sure you want to remove?");
if ( agree ) {
return true;
} else {
return false;
}
}
Code:
$('#POCs').delegate( "a.remove", "click", function(){
confirmPost();
var id = $(this).attr( 'id' ).replace( /remove-/, '' );
var team_id = $('#auto_cat').val();
$.ajax({
type: "POST",
url: "delete.php",
data: { id: id, bucket_id: team_id },
success: function(resp){
$('#POCs').empty();
$('#POCs').html( resp );
}
});
return false;
});
Any assistance on this matter would be greatly appreciated!
Comment