Welcome Guest, Not a member yet? Register   Sign In
Need Help in Deletion of a Record using Jquery ....!!!
#1

[eluser]Zeeshan Rasool[/eluser]
Hi guys i need some help in jquery i want to delete a record using jquery its working fine in case of sucess but how can i put a check to find failure state. I dont want to delete a category which has a subcategory so it removes the record from listing and when i refresh page it shows again so is there any way to track the failure and show an error so that user get information that its attempt is not succeeded..?

Thanks in advance

Here is my code..
Code:
$(document).ready(function() {
$('a.delete').click(function(e) {
e.preventDefault();
var parent = $(this).parent();
//var user_id = parent.attr('id').replace('my_div_id','');
if(confirm('Are you sure to delete this record?')==true ){
var category_id = URL;
$.ajax({
type: 'get',
url: '<?php echo base_url(); ?>/cms/delete_category/'+category_id,
data: parent.attr('id').replace('my_div_id',''),
beforeSend: function() {
parent.animate({'backgroundColor':'#fb6c6c'},300);
},
success: function() {
parent.slideUp(300,function() {
parent.remove();
});
}
});}
});
});


Messages In This Thread
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 01:53 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 02:26 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 02:42 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 03:06 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 03:52 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 04:43 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 05:04 AM
Need Help in Deletion of a Record using Jquery ....!!! - by El Forum - 05-04-2009, 05:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB