-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword.html
More file actions
126 lines (112 loc) · 5.86 KB
/
Copy pathpassword.html
File metadata and controls
126 lines (112 loc) · 5.86 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<title></title>
<style>
body{
backdrop-filter: blur(10px);
height: 641px;
}
.navbar {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.navbar-brand {
font-size: 2rem;
font-family:fantasy;
}
.home{
font-size: large;
font-weight: bold;
}
.home:hover{
color: orange;
}
</style>
<body style="background-image: url(image/home.jpg); background-size: cover;">
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">QuickBooking</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link home " aria-current="page" href="index.html" >Home</a>
</li>
<li class="nav-item">
<h5>
<a class="btn btn-danger" href="login.html">
<span class="sign">Login</span>
</a>
</h5>
</li>
<li class="nav-item">
<h5>
<a class="btn btn-primary" href="sign up.html">
<span class="sign">Sign Up</span>
</a>
</h5>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row justify-content-center" style="margin-top: 70px;">
<div class="col-md-4">
<h2 class="text-center"style="color: white;text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);">Reset You Password</h2>
<form id="resetPasswordForm">
<div class="mb-3">
<label for="emailOrMobile" class="form-label" style="color: white; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);">Email or Mobile Number</label>
<input type="text" class="form-control" id="emailOrMobile" placeholder="Enter Your Email or Mobile Number" required>
</div>
<div class="mb-3">
<label for="password" class="form-label" style="color: white; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);">New Password</label>
<input type="password" class="form-control" id="password" minlength="7" maxlength="12" placeholder="Enter Your New Password" required>
</div>
<div class="mb-3">
<label for="confirmPassword" class="form-label" style="color: white; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);">Confirm Password</label>
<input type="password" class="form-control" id="confirmPassword" minlength="7" maxlength="12" placeholder="Enter Your Confirm Password" required>
</div>
<center>
<button type="submit" class="btn btn-primary" style="width: 200px;">Submit</button>
</center>
</form>
<script>
// Custom validation for Email or Mobile Number, New Password, and Confirm Password
document.getElementById('resetPasswordForm').addEventListener('submit', function(event) {
// Get form fields
var emailOrMobile = document.getElementById('emailOrMobile').value;
var password = document.getElementById('password').value;
var confirmPassword = document.getElementById('confirmPassword').value;
// Regular expressions for validating email or mobile number
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
var mobilePattern = /^\d{10}$/; // 10-digit mobile number
// Check if email or mobile is valid
if (!emailPattern.test(emailOrMobile) && !mobilePattern.test(emailOrMobile)) {
alert('Please enter a valid email address or a 10-digit mobile number.');
event.preventDefault(); // Prevent form submission
return;
}
// Password length check (already handled with minlength/maxlength, but we can add extra check if needed)
if (password.length < 7 || password.length > 12) {
alert('Password must be between 7 and 12 characters.');
event.preventDefault(); // Prevent form submission
return;
}
// Confirm password check
if (password !== confirmPassword) {
alert('The passwords do not match.');
event.preventDefault(); // Prevent form submission
return;
}
});
</script>
</div>
</div>
</div>