main
Ilham Wara Nugroho 2026-02-04 15:06:29 +07:00
parent 6ba3881b7b
commit 2b67edc671
1 changed files with 16 additions and 10 deletions

View File

@ -84,7 +84,7 @@
</ul> </ul>
</div> </div>
@endif @endif
<form method="POST" id="form"> <form method="POST" id="form" enctype="multipart/form-data">
<input type="hidden" name="secure_id" value="{{encode_id($kuesioner->KuesionerId)}}"> <input type="hidden" name="secure_id" value="{{encode_id($kuesioner->KuesionerId)}}">
{{csrf_field()}} {{csrf_field()}}
<div class=""> <div class="">
@ -378,15 +378,9 @@
// $('input[type="checkbox"], input[type="radio"], input[type="text"], textarea').attr('disabled', true); // $('input[type="checkbox"], input[type="radio"], input[type="text"], textarea').attr('disabled', true);
}); });
@endif @endif
$('.page').on('click',function(e){ function getForm(number){
e.preventDefault();
let number = $(this).data('number');
let base_url = "{{url('/')}}"; let base_url = "{{url('/')}}";
// Tambahkan kelas active dan hapus dari yang lain $.ajax({
$('.page').removeClass('bg-primary-light border-primary text-primary');
$(this).addClass('bg-primary-light border-primary text-primary');
$.ajax({
url: base_url+'/getForm', // Ganti dengan URL API-mu url: base_url+'/getForm', // Ganti dengan URL API-mu
type: 'POST', // Bisa juga 'POST' kalau perlu type: 'POST', // Bisa juga 'POST' kalau perlu
xhrFields: { xhrFields: {
@ -442,6 +436,16 @@
$('#loading-spinner').hide(); // Sembunyikan spinner setelah request selesai $('#loading-spinner').hide(); // Sembunyikan spinner setelah request selesai
} }
}); });
}
$('.page').on('click',function(e){
e.preventDefault();
let number = $(this).data('number');
let base_url = "{{url('/')}}";
// Tambahkan kelas active dan hapus dari yang lain
$('.page').removeClass('bg-primary-light border-primary text-primary');
$(this).addClass('bg-primary-light border-primary text-primary');
getForm(number);
}); });
$('.resume').on('click',function(e){ $('.resume').on('click',function(e){
@ -647,6 +651,8 @@
$('.nilai_provinsi').html(response.nilai_prov); $('.nilai_provinsi').html(response.nilai_prov);
$('.page').closest('.bg-primary-light').addClass('bg-success-light border-success text-success'); $('.page').closest('.bg-primary-light').addClass('bg-success-light border-success text-success');
$('.page').closest('.bg-primary-light').removeClass('bg-primary-light border-primary border-secondary text-primary'); $('.page').closest('.bg-primary-light').removeClass('bg-primary-light border-primary border-secondary text-primary');
getForm(response.page_number);
}, },
error: function (xhr) { error: function (xhr) {
toastr.error( toastr.error(