-
Notifications
You must be signed in to change notification settings - Fork 0
/
reigster.html
76 lines (72 loc) · 2.89 KB
/
reigster.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SOJA : Register</title>
<link rel="stylesheet" href="/signstuff/style.css">
<style>
body {
background-image: url('/signstuff/logimg.jpg'); /* add your background image here */
background-size: cover;
background-position: center;
height: 100vh;
margin: 0;
}
</style>
</head>
<body>
<form>
<div class="container1">
<h1 class="head">Register</h1>
<div class="input-group">
<label for="email">Enter your Email-id:</label>
<input type="email" placeholder="[email protected]" name="email" id="email" class="subc">
</div>
<div class="input-group">
<label for="Username">Enter your Username:</label>
<input type="text" placeholder="Username" name="Username" id="Username" class="subc">
</div>
<div class="input-group">
<label for="npassword">Enter the password:</label>
<input type="password" placeholder="password" name="npassword" id="npassword" class="subc">
</div>
<div class="input-group">
<label for="cpassword">Confirm the password:</label>
<input type="password" placeholder="Confirm password" name="cpassword" id="cpassword" class="subc">
</div>
<div class="input-group">
<label for="dob">Enter your date of birth:</label>
<input type="date" name="dob" id="dob" class="subc">
</div>
<button id="button" onclick="submission()">
Submit
</button>
<p id="acc">Create an account ! <a href="login.html" style="text-decoration: none; color: aqua;">click here</a></p>
</div>
</form>
</body>
</html>
<script>
function submission() {
event.preventDefault(); // Prevent form submission
const email = document.getElementById("email").value;
const username = document.getElementById("Username").value;
const password = document.getElementById("npassword").value;
const confirmPassword = document.getElementById("cpassword").value;
const dob = document.getElementById("dob").value;
if (email.trim() === "" || username.trim() === "" || password.trim() === "" || confirmPassword.trim() === "" || dob.trim() === "") {
alert("All fields are required!");
return;
}
if (username.length < 5) {
alert("Username must be at least 5 characters long!");
return;
}
if (password !== confirmPassword) {
alert("Passwords do not match!");
return;
}
window.location.href = 'index.html';
}
</script>