form tabel
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
@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-row").click(function (e) {
|
||||
e.preventDefault();
|
||||
addForm('form-row');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user