I want to you the - SweetAlert for my Website. Now I need to configuration the SweetAlert with this code, so that on klick the "OK" button, it will send via POST formaction="/link/link" post="test=1"
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: " warning ",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
cancelButtonText: " No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false
}, function(isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
} else {
swal("Cancelled", "Your imaginary file is safe: ) ", " error ");
}
});
I want to ask you, how can I build it in.
Add you POST request trigger in the swal callback, like this:
The definition of the function
post()
is found here