style: add sweetalert after submit
parent
415e7b5cd3
commit
a772a545c2
|
|
@ -26,7 +26,7 @@
|
|||
<div class="h-8"></div>
|
||||
|
||||
<div class="card bg-white card-border">
|
||||
<form action="" method="post">
|
||||
<form id="createAlatPengumpulForm" action="" method="post">
|
||||
<div class="card-body">
|
||||
<span class="font-medium text-xl">
|
||||
Wilayah
|
||||
|
|
@ -197,4 +197,28 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const form = document.getElementById('createAlatPengumpulForm');
|
||||
if (!form) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.addEventListener('submit', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: 'Data alat pengumpul sampah berhasil disimpan.',
|
||||
icon: 'success',
|
||||
confirmButtonColor: '#22c55e',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<div class="h-8"></div>
|
||||
|
||||
<div class="card bg-white card-border">
|
||||
<form action="" method="post">
|
||||
<form id="editAlatPengumpulForm" action="" method="post">
|
||||
<input type="hidden" name="id" value="@Model?.Id" />
|
||||
<div class="card-body">
|
||||
<span class="font-medium text-xl">
|
||||
|
|
@ -228,3 +228,27 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const form = document.getElementById('editAlatPengumpulForm');
|
||||
if (!form) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.addEventListener('submit', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: 'Data alat pengumpul sampah berhasil diperbarui.',
|
||||
icon: 'success',
|
||||
confirmButtonColor: '#22c55e',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
Loading…
Reference in New Issue