Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function(){
- $( "#confirm_delete" ).submit(function( event ) {
- event.preventDefault();
- swal({
- title: 'Are you sure?',
- text: "Please click confirm to delete this item",
- type: 'warning',
- showCancelButton: true,
- confirmButtonColor: '#3085d6',
- cancelButtonColor: '#d33',
- confirmButtonText: 'Yes, delete it!',
- cancelButtonText: 'No, cancel!',
- confirmButtonClass: 'btn btn-success',
- cancelButtonClass: 'btn btn-danger',
- buttonsStyling: true
- }).then(function() {
- $("#confirm_delete").off("submit").submit();
- }, function(dismiss) {
- // dismiss can be 'cancel', 'overlay',
- // 'close', and 'timer'
- if (dismiss === 'cancel') {
- swal('Cancelled', 'Delete Cancelled :)', 'error');
- }
- })
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement