-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
47 lines (40 loc) · 1.23 KB
/
index.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/style.css">
<title>Document</title>
</head>
<body>
<h1>Login</h1>
<form class="login-form" id="login-form">
<div>
<label>Username</label>
<input type="text" value="teacher" id="login-name">
</div>
<div>
<label>Password</label>
<input type="password" value="admin" id="login-password">
</div>
<button type="submit" id="login-button">Login</button>
</form>
<script>
function checkTeacherCredentials() {
var form = document.getElementById('login-form');
var defaultName = 'teacher';
var defaultPassword = 'admin';
form.onsubmit = function (e) {
e.preventDefault();
var username = document.getElementById('login-name').value;
var password = document.getElementById('login-password').value;
if (username == defaultName && password == defaultPassword) {
window.location.href = '/reportcard.html'
}
}
}
checkTeacherCredentials();
</script>
</body>
</html>