-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSignup.html
More file actions
329 lines (285 loc) · 8.85 KB
/
Signup.html
File metadata and controls
329 lines (285 loc) · 8.85 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Update Profile</title>
<script>
// Email validation
function validateEmail() {
const email = document.getElementById('email').value;
const emailMessage = document.getElementById('emailMessage');
const emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
if (!emailPattern.test(email)) {
emailMessage.textContent = "Please enter a valid email address.";
return false;
}
emailMessage.textContent = "";
return true;
}
// Restrict input to letters only for First Name and Last Name
function validateNameInput(event) {
const char = String.fromCharCode(event.which);
if (!/[a-zA-Z ]/.test(char)) {
event.preventDefault();
}
}
// Restrict input to digits only for Mobile Number
function validateMobileInput(event) {
const char = String.fromCharCode(event.which);
if (!/[0-9]/.test(char)) {
event.preventDefault();
}
}
// Password validation
function validatePassword() {
const password = document.getElementById('password').value;
const rePassword = document.getElementById('rePassword').value;
const passwordMessage = document.getElementById('passwordMessage');
// Check if password meets criteria
const isValid = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*]).{6,}$/.test(password);
if (!isValid) {
passwordMessage.textContent = "Password must be at least 6 characters long and include letters, numbers, and symbols.";
return false;
}
// Check if passwords match
if (password !== rePassword) {
passwordMessage.textContent = "Passwords do not match.";
return false;
}
passwordMessage.textContent = "";
return true;
}
// Attach validation to input fields
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('firstName').addEventListener('keypress', validateNameInput);
document.getElementById('lastName').addEventListener('keypress', validateNameInput);
document.getElementById('mobile').addEventListener('keypress', validateMobileInput);
// Validate email on blur
document.getElementById('email').addEventListener('blur', validateEmail);
// Validate password on form submission
document.querySelector('.update-form').addEventListener('submit', (event) => {
if (!validatePassword() || !validateEmail()) {
event.preventDefault();
}
});
});
</script>
<style>
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #f4f4f9;
color: #333;
}
/* Navbar */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #002b5c;
color: white;
padding: 10px 20px;
}
.navbar .logo {
font-size: 1.5em;
font-weight: bold;
}
.navbar ul {
list-style: none;
display: flex;
gap: 15px;
}
.navbar ul li a {
text-decoration: none;
color: white;
}
.auth-buttons .login,
.auth-buttons .signup {
background-color: white;
border: none;
padding: 5px 10px;
margin-left: 10px;
cursor: pointer;
}
.signup {
background-color: #1d5ef6;
color: white;
}
/* Form */
.form-container {
padding: 20px;
max-width: 800px;
margin: auto;
background: white;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.form-container h1 {
text-align: center;
margin-bottom: 20px;
}
.update-form {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group input,
.form-group textarea {
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
margin-top: 5px;
}
.photo-upload input {
padding: 5px;
}
.save-button {
grid-column: span 2;
background-color: #002b5c;
color: white;
border: none;
padding: 10px 20px;
cursor: pointer;
border-radius: 5px;
}
/* Footer */
footer {
background-color: #002b5c;
color: white;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
padding: 20px;
}
footer .footer-logo {
font-size: 1.2em;
font-weight: bold;
}
footer a {
color: white;
text-decoration: none;
}
.newsletter input {
padding: 10px;
margin-top: 10px;
}
.newsletter button {
margin-top: 5px;
padding: 10px 15px;
background-color: #1d5ef6;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<!-- Navbar -->
<header class="navbar">
<div class="logo">TaxGen</div>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Calculate</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
<div class="auth-buttons">
<button class="login" href="./Login.html">Login</button>
</div>
</header>
<!-- Form -->
<main class="form-container">
<h1>Update Your Profile</h1>
<form class="update-form" action="save_profile.php" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="firstName">First Name *</label>
<input type="text" id="firstName" name="first_name" placeholder="Enter First Name" required>
</div>
<div class="form-group">
<label for="lastName">Last Name *</label>
<input type="text" id="lastName" name="last_name" placeholder="Enter Last Name" required>
</div>
<div class="form-group">
<label for="dob">Date of Birth *</label>
<input type="date" id="dob" name="dob" required>
</div>
<div class="form-group">
<label for="nic">NIC No *</label>
<input type="text" id="nic" name="nic" placeholder="Enter Your NIC Number" required>
</div>
<div class="form-group">
<label for="mobile">Mobile No *</label>
<input type="text" id="mobile" name="mobile" placeholder="Enter Your Mobile Number" required>
</div>
<div class="form-group photo-upload">
<label for="photo">Upload Your Photo *</label>
<input type="file" id="photo" name="photo" accept="image/*" required>
</div>
<div class="form-group">
<label for="residentialAddress">Residential Address *</label>
<textarea id="residentialAddress" name="residential_address" placeholder="Enter Your Address" required></textarea>
</div>
<div class="form-group">
<label for="mailingAddress">Mailing Address *</label>
<textarea id="mailingAddress" name="mailing_address" placeholder="Enter Your Mailing Address" required></textarea>
</div>
<div class="form-group">
<label for="email">Email *</label>
<input type="email" id="email" name="email" placeholder="Enter Your Email Address" required>
<span id="emailMessage" style="color: red; font-size: 0.9em;"></span>
</div>
<div class="form-group">
<label for="password">Password *</label>
<input type="password" id="password" name="password" placeholder="Enter Your Password" required>
</div>
<div class="form-group">
<label for="rePassword">Re-enter Password *</label>
<input type="password" id="rePassword" name="re_password" placeholder="Re-enter Your Password" required>
<span id="passwordMessage" style="color: red; font-size: 0.9em;"></span>
</div>
<button type="submit" class="save-button">Save</button>
</form>
</main>
<!-- Footer -->
<footer>
<div class="footer-content">
<div class="footer-logo">TaxGen</div>
<p>TaxGen is an innovative tax management solution...</p>
</div>
<div class="footer-links">
<h3>Quick Links</h3>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Packages</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
<div class="newsletter">
<h3>Join Our Newsletter</h3>
<input type="email" placeholder="Enter Your Email">
<button>Subscribe</button>
</div>
<div class="contact">
<h3>Get in Touch</h3>
<p>+94 77 543 9120</p>
<div class="social-icons">
<a href="#">Email</a>
<a href="#">Twitter</a>
<a href="#">Facebook</a>
</div>
</div>
</footer>
</body>
</html>