Advertisement
Guest User

Confirm delete

a guest
Jan 26th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function() {
  2.  
  3.  
  4. $(".delbutton").click(function(){
  5.  
  6. //Save the link in a variable called element
  7. var element = $(this);
  8.  
  9. //Find the id of the link that was clicked
  10. var del_id = element.attr("id");
  11.  
  12. //Built a url to send
  13. var info = 'id=' + del_id;
  14.  if(confirm("Are you sure you want to delete this Record?"))
  15.           {
  16.  
  17.  $.ajax({
  18.    type: "GET",
  19.    url: "delete.php",
  20.    data: info,
  21.    success: function(){
  22.    
  23.    }
  24.  });
  25.          $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
  26.         .animate({ opacity: "hide" }, "slow");
  27.  
  28.  }
  29.  
  30. return false;
  31.  
  32. });
  33.  
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement