-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.html
68 lines (65 loc) · 2.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script>
function validatePassword() {
var password = document.getElementById("password").value;
var repeatPassword = document.getElementById("repeat-password").value;
var passwordRegex = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{8,}$/;
if (!password.match(passwordRegex)) {
alert("Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one digit, and one special character.");
return false;
}
if (password !== repeatPassword) {
alert("Passwords do not match.");
return false;
}
return true;
}
</script>
</head>
<body>
<div class="registration-container">
<h2>Register</h2>
<form action="register.php" method="post">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<label for="repeat-password">Repeat Password</label>
<input type="password" id="repeat-password" name="repeat-password" required>
</div>
<div class="form-group">
<label for="gender">Gender</label>
<select id="gender" name="gender" required>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
</div>
<div class="form-group">
<label for="dob">Date of Birth</label>
<input type="date" id="dob" name="dob" required>
</div>
<button type="submit" class="register-btn">Register</button>
</form>
</div>
</body>
</html>