Welcome Guest, Not a member yet? Register   Sign In
Need Idea for confirm before delete using confirm
#1

Hi CI Team,

I need yours idea how to solve this,

When I click "Delete" system automatically deleted without confirm.

PHP Code:
<a href="'.site_url("admin/delete_user/" . $r->ID . "/" . $this->security->get_csrf_hash()).'" class="btn btn-danger btn-sm" onclick="return confirm();">Delete</a


Code:
<script type="text/javascript">
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(confirm){
if (confirm) {
    swal("Deleted!", "Your imaginary file has been deleted.", "success");
} else {
    swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
</script>

Source: https://sweetalert.js.org/

Thanks
Reply


Messages In This Thread
Need Idea for confirm before delete using confirm - by googlemy - 02-04-2018, 03:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB