Guest User

Guest User

  • Tech Writer
  • 611
  • 115.2k

Sweet Aleart Success Message.

Sep 7 2020 11:02 PM
How to show success message after upload file using sweet aleart.
function validateData() {
debugger;
if ($("#CategoriesImages").val() == "") {
sweetAlert("File Shouldn't Be Empty!!", "Please select file", "error");
return false;
} else if ($("#Name").val() == "") {
sweetAlert("Please Enter Category Name!", "", "error");
return false;
} else {
swal({
title: "Confirmation?",
text: "Are you sure you want to Upload this File?",
type: "warning",
confirmButtonClass: "btn-danger",
showCancelButton: true,
confirmButtonText: "Yes !",
closeOnConfirm: false
},
function (isConfirm) {
if (!isConfirm) return;
$.ajax({
success: function () {
swal({
title: "Done", text: "It was Successfully Uploaded File!",
type: "success"
}, function () {
location.reload();
});
},
error: function (xhr, ajaxOptions, thrownError) {
swal("Error Uploading File!", "Please try again", "error");
}
});
});
};
It's me code it's working but success message not show after upload file 

Answers (3)