forked from multiverseweb/Dataverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.html
74 lines (71 loc) · 3.49 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.login-container{
width: 500px;
height: 500px;
position: relative;
top: 100px;
left: 450px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<div style="text-align: right; margin: 10px;">
<a href="index.html" class="btn btn-secondary" style="width: 150px; position: relative; right: 1330px;">Back to Home</a>
</div>
<div class="login-container" style="padding-top: 20px;">
<h2 style="text-align: center;">Signup</h2>
<div class="mb-3" style="margin-left: 40px;">
<label for="exampleFormControlInput1" class="form-label">Email address</label>
<input type="email" class="form-control" id="emailInput" placeholder="name@example.com" style="width: 400px;">
</div>
<div class="mb-3" style="margin-left: 40px;">
<label for="inputPassword5" class="form-label">Password</label>
<input type="password" placeholder="Enter your Password" id="passwordInput" class="form-control" aria-describedby="passwordHelpBlock" style="width: 400px">
<div id="passwordHelpBlock" class="form-text" style="width: 400px">
Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.
</div>
</div>
<div class="mb-3" style="margin-left: 40px;">
<label for="inputPassword5" class="form-label"> Confirm Password</label>
<input type="password" placeholder="Confirm your Password" id="confirmPasswordInput" class="form-control" aria-describedby="passwordHelpBlock" style="width: 400px">
</div>
<button type="button" class="btn btn-primary" id="signupButton" style="width: 400px; margin-left: 40px;">Signup</button>
<div style="text-align: center; margin-top: 10px;">
<p>Already have an accout ? <a href="login.html" style="text-decoration: none;">Login</a></p>
</div>
</div>
<script>
document.getElementById('signupButton').addEventListener('click', function() {
const emailInput = document.getElementById('emailInput');
const passwordInput = document.getElementById('passwordInput');
const confirmPasswordInput = document.getElementById('confirmPasswordInput');
const emailValue = emailInput.value.trim();
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!emailRegex.test(emailValue)) {
alert('Invalid email address');
return;
}
// Check if passwords match
if (passwordInput.value !== confirmPasswordInput.value) {
alert('Both Passwords do not match');
return;
}
emailInput.value = '';
passwordInput.value = '';
confirmPasswordInput.value = '';
window.location.href = 'login.html';
alert('Your Accout has been cteated successfully!');
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>