$('#formKehadiranIndividu').on('submit', function(e) { e.preventDefault(); $.ajax({ url: 'individu_update.php', type: 'POST', data: $(this).serialize(), dataType: 'json', success: function(response) { if (response.status) { Swal.fire({ icon: 'success', title: 'Berjaya', text: response.message }); } else { Swal.fire({ icon: 'error', title: 'Ralat', text: response.message }); } }, error: function(xhr) { Swal.fire({ icon: 'error', title: 'Ralat Server', text: 'Gagal memproses permintaan.' }); console.log(xhr.responseText); } }); });