-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
24 lines (17 loc) · 948 Bytes
/
script.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
document.getElementById('login-form').addEventListener('submit', function (e) {
e.preventDefault();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
// List of valid email addresses
const validEmails = ['[email protected]', '[email protected]', '[email protected]', '[email protected]'];
// Here, you would typically send a request to the server for authentication
// and handle the response accordingly.
// For demonstration purposes, we'll check against the list of valid email addresses.
if (validEmails.includes(email) && password === 'password') {
alert('Login successful! Redirecting to the home page...');
// Redirect to the home page
window.location.href = 'treatment option.html';
} else {
alert('Invalid email or password. Please try again.');
}
});