TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
611
127.7k
Set sweet alert in jquery.
Sep 2 2020 6:41 AM
I have use this code for delete record with sweet aleart .It's not working with sweet aleart and without sweet aleart it's working .please help me.
$(document).ready(
function
() {
$(
"#Report"
).on(
'click'
,
'.btndelete'
,
function
() {
swal({
title:
"Confirmation?"
,
text:
"Are you sure you want to delete record?"
,
type:
"warning"
,
confirmButtonClass:
"btn-danger"
,
showCancelButton:
true
,
confirmButtonText:
"Yes,Please Delete it!"
,
closeOnConfirm:
false
},
function
() {
swal(
"Deleted!"
,
"Data has been successfully deleted."
,
"success"
);
});
var
ab = $(
this
).closest(
'#item'
);
ab.remove();
var
id = $(
this
).attr(
'id'
);
$.ajax({
url:
"DeleteReport"
,
type:
"POST"
,
data: {
"ContactUsId"
: id },
success:
function
(data) {
if
(data.status ==
true
) {
$(
this
).closest(
'#item'
).remove();
}
else
{
alert(
"Something went wrong"
);
return
false
;
}
},
error:
function
(er) {
alert(er);
return
false
;
}
});
});
});
Reply
Answers (
6
)
How to copy a row in excel using C#
How can I make watch app