-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecaIndex.html
73 lines (59 loc) · 2.17 KB
/
DecaIndex.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>HTML Login Form</title>
<link rel="stylesheet"
href="Css/Deca.css">
</head>
<body>
<div class="main">
<h1>D.E.C.A</h1>
<h3>Enter your login credentials</h3>
<label for="first">
Username:
</label>
<input type="text"
id="first"
name="first"
placeholder="Enter your Username" required>
<label for="first">Username:</label>
<input type="text" id="first" name="first" placeholder="Enter your Username" required>
<label for="password">
Password:
</label>
<input type="password"
id="password"
name="password"
placeholder="Enter your Password" required>
<div class="wrap">
<button type="submit" onclick="login()">
<script src ="Js/Deca.js"> </script>
Submit
</button>
</div>
</form>
</div>
</body>
</html>
<div class="wrap">
<button type="button" onclick="submitLogin()">Login</button>
<p id="login-message"></p>
</div>
<script>
function submitLogin() {
const username = document.getElementById("first").value;
const password = document.getElementById("password").value;
if (username === "staff" && password === "staff") {
document.getElementById("login-message").textContent = "Login successful!";
window.location.href = "staffPage.html";
} else if (username === "admin" && password === "admin") {
document.getElementById("login-message").textContent = "Login successful!";
window.location.href = "adminPage.html";
} else {
document.getElementById("login-message").textContent = "Login failed. Please check your username and password.";
}
}
</script>
</div>
</body>
</html>