diff --git a/resources/views/form/rapport-horizon/1793272971-f2e4a8b3-d211-46ba-b867-69d4b85da68d.blade.php b/resources/views/form/rapport-horizon/1793272971-f2e4a8b3-d211-46ba-b867-69d4b85da68d.blade.php index 8dda82be..25cc6f01 100644 --- a/resources/views/form/rapport-horizon/1793272971-f2e4a8b3-d211-46ba-b867-69d4b85da68d.blade.php +++ b/resources/views/form/rapport-horizon/1793272971-f2e4a8b3-d211-46ba-b867-69d4b85da68d.blade.php @@ -312,7 +312,37 @@ text: 'Your data is successfully submitted!', icon: 'success' }) + // Reset normal form fields $('#report-form').trigger("reset"); + + // Clear the captured photo + if (photoInput) { + photoInput.value = ''; + } + + // Clear the captured photo preview + if (preview) { + preview.src = ''; + preview.style.display = 'none'; + } + + // Hide the camera preview + if (video) { + video.style.display = 'none'; + } + + // Stop the camera if it is still running + stopPhotoCamera(); + + // Reset camera buttons + $('#start-photo-camera').show(); + $('#capture-photo').hide(); + $('#retake-photo').hide(); + + // Restore today's date after resetting the form + if (dateField) { + dateField.value = currentDate; + } } else { Swal.fire({ icon: 'error', @@ -340,7 +370,7 @@ dateField.setAttribute('max', currentDate); dateField.style.pointerEvents = 'none'; } - + let photoStream = null;