Files
database-pertani-web/resources/views/ekosistem/form-basis-data/add-hr-line.blade.php
T
2026-05-15 15:31:19 +07:00

27 lines
924 B
PHP

@push('scripts')
<script>
$(document).ready(function() {
function addForm(tipe) {
$.ajax({
url: '{{ route('tabel.formulir.store', [$tabel->id]) }}',
type: 'POST',
data: {
tipe: tipe,
_token: '{{ csrf_token() }}',
},
success: function () {
Swal.fire({ icon: 'success', title: 'Berhasil!', showConfirmButton: false, timer: 1500 })
.then(() => window.location.reload());
},
error: function (xhr) {
Swal.fire({ icon: 'error', title: 'Gagal!', text: xhr.responseJSON?.message || 'Error' });
}
});
}
$(".add-hr-line").click(function (e) {
e.preventDefault();
addForm('form-hr-line');
});
});
</script>
@endpush