You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var category = new Object();
category.CategoryId = $("#categoryId").val();
category.CategoryName = $("#categoryName").val();
category.Status = $("#status").val();
var data = JSON.stringify({
category: category
});
document.getElementById('success-message').onclick = function () {
swal('Success!', 'Category is Saved!', 'success')
};
swal({
Position:'top-end',
icon: "success",
title: 'Your work has been saved',
showConfirmButton: false,
timer:1500
}).then(function (isConfirm) {
if (isConfirm) {
return $.ajax({
contentType: 'application/json; charset=ut-8',
dataType: 'json',
type: 'POST',
url: "/Home/SaveCategory",
data: data,
success: function (result) {
if (result == true) {
GetAllCategory();
dataTable.ajax.reload();
}
}
});
} else {
swal("Cancelled", "You have Cancelled Form Submission!", "error");
$("#categoryModal").modal('hide');
}
});
}
The text was updated successfully, but these errors were encountered:
Emmanuelf7
changed the title
sweetalert popup without saving data in the database
Submit button brings sweetalert popup without saving data in the database
Mar 5, 2023
function saveCategory() {
The text was updated successfully, but these errors were encountered: