xxxxxxxxxx
/**
*
* @param {*} formIds
*/
function formSubmitConfirmation(formIds) {
$(formIds).on("submit", function (e) {
e.preventDefault(); // Prevent the form from submitting normally
const form = this; // Store the form element in a variable
// Display a SweetAlert confirmation dialog
Swal.fire({
title: "Are you sure?",
text: "You will not be able to undo this action.",
icon: "warning",
showCancelButton: true,
confirmButtonText: "Yes, submit it!",
cancelButtonText: "No, cancel it",
}).then((result) => {
if (result.isConfirmed) {
// If the user confirms, submit the form
form.submit();
}
});
});
}