-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.html
149 lines (142 loc) · 7.12 KB
/
register.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Register Page</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/templatemo-stand-blog.css">
</head>
<<<<<<< HEAD
<style>
.error-message {
color: #ff0000;
margin-top: 5px;
font-size: 15px;
}
</style>
=======
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748
<body>
<div class="container">
<div class="login-pg-logos">
<img src="assets/images/apiit-logo.png" alt="" width="auto" height="75px">
<img src="assets/images/BrandLogo.png" alt="" width="250px" height="100px">
</div>
<div class="row justify-content-center mt-5">
<div class="col-md-6">
<div class="card">
<h5 class="card-header">Register</h5>
<div class="card-body">
<form action="register.php" method="post" id="registerForm">
<div class="form-group">
<label for="user-type">Who are you?</label>
<select class="form-control" id="user-type" name="user-type" required>
<option value="">Select</option>
<option value="student">Student</option>
<option value="lecturer">Lecturer</option>
<<<<<<< HEAD
<!--option value="alumni">Alumni</option>
<option value="admin">Admin</option-->
=======
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748
</select>
</div>
<div class="form-group">
<label for="full-name">Full Name</label>
<<<<<<< HEAD
<input type="text" class="form-control" id="full-name" name="full-name"
pattern="[A-Za-z ]+" title="Please enter letters only" required />
=======
<input type="text" class="form-control" id="full-name" name="full-name" pattern="[A-Za-z ]+" title="Please enter letters only" required />
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748
</div>
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" id="username" name="username" required />
<<<<<<< HEAD
<span id="username-error-message" class="error-message"></span>
</div>
<div class="form-group">
<label for="email">APIIT Email address</label>
<input type="email" class="form-control" id="email" name="email" required />
<span id="email-error-message" class="error-message"></span>
=======
</div>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" name="email" required />
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" required />
</div>
<div class="form-group">
<label for="confirm-password">Confirm Password</label>
<<<<<<< HEAD
<input type="password" class="form-control" id="confirm-password"
name="confirm-password" required />
<span id="password-mismatch-error-message" class="error-message"></span>
</div>
<button type="submit" class="btn btn-primary">Register</button>
<button type="button" onclick="window.location.href = 'login.html';" class="btn back-primary">Back</button>
=======
<input type="password" class="form-control" id="confirm-password" name="confirm-password" required />
<p id="password-error" style="color: red; display: none;">Passwords do not match.</p>
</div>
<button type="submit" class="btn btn-primary" onclick="return validatePassword()">Register</button>
<button type="button" onclick="history.back()" class="btn back-primary">Back</button>
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
<<<<<<< HEAD
$(document).ready(function () {
const searchParams = new URLSearchParams(window.location.search);
if (searchParams.has("error")) {
const errorMessage = searchParams.get("error");
switch (errorMessage) {
case "email_format":
$('#email-error-message').text("Invalid email format").addClass('error-message');
break;
case "email_domain":
$('#email-error-message').text("Invalid email").addClass('error-message');
break;
case "password_mismatch":
$('#password-mismatch-error-message').text("Passwords do not match").addClass('error-message');
break;
case "username_exists":
$('#username-error-message').text("Username already exists").addClass('error-message');
break;
case "email_exists":
$('#email-error-message').text("Email already exists").addClass('error-message');
break;
default:
$('#email-error-message').text("An error occurred. Please try again later.").addClass('error-message');
break;
}
}
});
</script>
</body>
</html>
=======
function validatePassword() {
var password = document.getElementById("password").value;
var confirmPassword = document.getElementById("confirm-password").value;
if (password != confirmPassword) {
document.getElementById("password-error").style.display = "block";
return false;
}
return true;
}
</script>
</body>
</html>
>>>>>>> 8c76a2d33609c46eed97aeb0d1d903eeca2d1748