-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforget_password.html
More file actions
38 lines (37 loc) · 1.38 KB
/
forget_password.html
File metadata and controls
38 lines (37 loc) · 1.38 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forgot Password</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function validateForm(event) {
event.preventDefault(); // Prevent default form submission
var email = document.getElementById('email').value.trim();
// Validating email format
if (/\S+@\S+\.\S+/.test(email)) {
// If email format is correct, redirecting to the reset password page
window.location.href = 'reset_password.html';
} else {
// If email format is incorrect, showing an error message
alert("Please enter a valid email address.");
}
}
</script>
</head>
<body>
<div class="form-container">
<form class="my-form" onsubmit="validateForm(event)">
<h2>Forgot Password</h2>
<div class="form-control">
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Enter your Email">
</div>
<div class="form-control">
<button type="submit" class="btn">Submit</button>
</div>
</form>
</div>
</body>
</html>