-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfeedback.js
26 lines (21 loc) · 1.01 KB
/
feedback.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
document.getElementById('feedback-form').addEventListener('submit', function(event) {
event.preventDefault();
// Show the thank you modal
let modal = document.getElementById('feedback-modal');
modal.classList.add('show');
// Optionally, clear the form fields if you want to
document.getElementById('feedback-form').reset();
// Set a timeout to redirect after a few seconds
setTimeout(function() {
modal.classList.remove('show');
window.history.back(); // Go back to the previous page
}, 3000); // Adjust the time as needed
});
// Close the feedback page when the close button on the form is clicked
document.getElementById('close-feedback-btn').addEventListener('click', function() {
window.history.back(); // Go back to the previous page
});
// Close the modal when the close button in the modal is clicked
document.getElementById('close-btn').addEventListener('click', function() {
document.getElementById('feedback-modal').classList.remove('show');
});