-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.html
More file actions
76 lines (60 loc) · 2.61 KB
/
signup.html
File metadata and controls
76 lines (60 loc) · 2.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Create Account - InternPing</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<!-- Sign Up Form -->
<section id="signup-section">
<h2>Create Account</h2>
<form id="signup-form">
<!-- First Name -->
<label for="first-name">First Name:</label>
<input type="text" id="first-name" name="first-name" required>
<!-- Last Name -->
<label for="last-name">Last Name:</label>
<input type="text" id="last-name" name="last-name" required>
<!-- Age -->
<label for="age">Age:</label>
<input type="number" id="age" name="age" required>
<!-- Gender Dropdown -->
<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>
<!-- Username -->
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<!-- Email -->
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<!-- Password -->
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<!-- Confirm Password -->
<label for="confirm-password">Confirm Password:</label>
<input type="password" id="confirm-password" name="confirm-password" required>
<!-- Password Match Check (JavaScript) -->
<p id="password-error" style="color: red; display: none;">Passwords do not match</p>
<!-- Submit Button -->
<input type="submit" value="Create Account">
</form>
</section>
<script>
// JavaScript to check if passwords match
const passwordInput = document.getElementById('password');
const confirmPasswordInput = document.getElementById('confirm-password');
const passwordError = document.getElementById('password-error');
const signupForm = document.getElementById('signup-form');
signupForm.addEventListener('submit', function(e) {
if (passwordInput.value !== confirmPasswordInput.value) {
e.preventDefault(); // Prevent form submission
passwordError.style.display = 'block'; // Show error message
}
});
</script>
</body>
</html>