Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sweet alert confirm box laravel

$(document).on('click', '.button', function (e) {
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure!",
            type: "error",
            confirmButtonClass: "btn-danger",
            confirmButtonText: "Yes!",
            showCancelButton: true,
        },
        function() {
            $.ajax({
                type: "POST",
                url: "{{url('/destroy')}}",
                data: {id:id},
                success: function (data) {
                              //
                    }         
            });
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sweet #alert #confirm #box #laravel
ADD COMMENT
Topic
Name
1+9 =