forked from codingkatty/mathpylearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.js
20 lines (18 loc) · 815 Bytes
/
feedback.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function handleSubmit() {
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const rating = document.getElementById('rating').value;
const comments = document.getElementById('comments').value;
const responseMessage = document.getElementById('responseMessage');
if (!name || !email || !rating || !comments) {
responseMessage.textContent = 'Please fill in all the fields.';
responseMessage.classList.add('error');
return false;
}
responseMessage.textContent = `Thank you, ${name}, for your feedback!`;
responseMessage.classList.remove('error');
return false; // Prevents form submission for demo purposes
}
function goBack() {
window.location.href = "index.html"; // Redirect to index.html
}