Created
January 24, 2025 22:43
-
-
Save jlcarrascof/66dcaed8deaaec0e83e14643dbb154c2 to your computer and use it in GitHub Desktop.
Laravel 11 - Invoicing - Video 16 - SweetAlert code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function confirmDelete(categoryId) { | |
Swal.fire({ | |
title: '¿Are you sure to delete?', | |
text: "¡Confirm delete, please!", | |
icon: 'warning', | |
showCancelButton: true, | |
confirmButtonColor: '#3085d6', | |
cancelButtonColor: '#d33', | |
confirmButtonText: 'Yes', | |
cancelButtonText: 'Cancel' | |
}).then((result) => { | |
if (result.isConfirmed) { | |
// Send the deletion form | |
document.getElementById(`delete-form-${categoryId}`).submit(); | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment