Skip to content

Commit

Permalink
Update index.html (#491)
Browse files Browse the repository at this point in the history
Added functionality to feedback form

Co-authored-by: Vamshi Maskuri <[email protected]>
  • Loading branch information
ananyag309 and varshith257 authored Jun 9, 2024
1 parent df3fb8e commit 27abd90
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,37 @@ <h1>Give Us Your Valuable Feedback.</h1>

</div>
</section>
<script>
function submitFeedback(event) {
event.preventDefault();

// Get the feedback data
const feedbackText = document.getElementById('textarea').value;
const satisfaction = document.querySelector('input[name="satisfaction"]:checked');

if (!satisfaction) {
alert('Please select your satisfaction level.');
return;
}

// Here you would normally send the feedback to the server
// For this example, we'll just display a confirmation message

// Display the confirmation message
const confirmationMessage = document.getElementById('confirmation-message');
confirmationMessage.style.display = 'block';

// Reset the form
document.getElementById('textarea').value = '';
document.querySelector('input[name="satisfaction"]:checked').checked = false;

// Hide the confirmation message after a few seconds
setTimeout(() => {
confirmationMessage.style.display = 'none';
}, 6000);
}
</script>



</main><!-- End #main -->
Expand Down

0 comments on commit 27abd90

Please sign in to comment.