-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
309 lines (283 loc) · 14.4 KB
/
index.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
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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Registration </title>
<script src="index.js"></script>
</head>
<body>
<div class="container">
<h1 style="text-align: center;padding-top: 15px;padding-bottom: 15px;">Registration Form</h1>
<form onsubmit="return myFun()" id="myForm">
<div class="form-row">
<div class="form-group col-md-6">
<label for="inpufname"><img class="image" src="Image/6218121.png" />First Name:</label>
<input type="text" class="form-control" id="inputfname" placeholder="First Name" autocomplete="off"
onkeyup="firstname()">
<p id="sms1" class="text-warning"></p>
</div>
<div class="form-group col-md-6">
<label for="inputlname"><img class="image" src="Image/6218121.png" />Last Name:</label>
<input type="text" class="form-control" id="inputlname" placeholder="Last Name" autocomplete="off"
onkeyup="lastname()">
<p id="sms2" class="text-warning"></p>
</div>
</div>
<div class="form-group">
<label for="inputemail"><img class="image" src="Image/email.png" alt="image"> Email address:</label>
<input type="text" class="form-control" id="inputemail" placeholder="[email protected]"
autocomplete="off" onkeyup="emailFunction()">
<p id="sms3" class="text-warning"></p>
</div>
<div class="form-group">
<label for="inputpassword"> <img class="image" src="Image/pass.png" alt="image" /> Password:</label>
<input type="password" class="form-control" id="pass1" placeholder="Password" onkeyup="password()">
<p id="sms4" class="text-warning"></p>
</div>
<div class="form-group">
<label for="inputconfirmpassword"><img class="image" src="Image/pass.png" alt="image" />Confirm
Password:</label>
<input type="password" class="form-control" id="pass2" placeholder="Confirm Password"
onkeyup="conpassword()">
<p id="sms5" class="text-warning"></p>
</div>
<div class="form-group">
<div class="row d-flex">
<div class="col-md-5 ">
<label for="gender"><img class="image" src="Image/gender.jpeg" alt="image" />Gender:</label>
<div class="form-check form-check-inline">
<span id="gendererror"></span>
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="male"
value="option1" onclick="validateGender">
<label class="form-check-label" for="inlineRadio1">Male</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="female"
value="option2" onclick="validateGender">
<label class="form-check-label" for="inlineRadio2">Female</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="other"
value="option3" onclick="validateGender">
<label class="form-check-label" for="inlineRadio3">Other</label>
</div>
</div>
<div class="col-md-5">
<label for="languageknown"><img class="image" src="Image/language.jpeg" alt="image" />Language
Known:</label>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="hindi" value="option1"
onclick="validateLanguageKnown">
<label class="form-check-label" for="inlineCheckbox1">Hindi</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="english" value="option2"
onclick="validateLanguageKnown">
<label class="form-check-label" for="inlineCheckbox2">English</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="other" value="option3"
onclick="validateLanguageKnown">
<label class="form-check-label" for="inlineCheckbox3">Other</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="inputdob"><img class="image" src="Image/download.jpeg" alt="image">Date Of Birth:</label>
<input type="date" class="form-control" id="inputdob" placeholder="[email protected]" onclick="dbirth()"
required>
<p id="sms6" class="text-warning"></p>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="country-select"><img class="image" src="Image/country.png" alt="image">Select
Country:</label>
<select id="country-select" onclick="validatePhone()" class="form-control">
<option value="usa">Please select country</option>
<option value="vietnam">Vietnam</option>
<option value="india">India</option>
<option value="china">China</option>
<option value="uae">UAE</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="inputcode"><img class="image" src="Image/conicon.jpeg" alt="image">Country Code</label>
<input type="text" class="form-control" id="inputcode" readonly>
</div>
<div class="form-group col-md-6">
<label for="inputphone"><img class="image" src="Image/phone.png" alt="image">Enter Phone
Number:</label>
<input type="tel" class="form-control" id="inputphone" minlength="10" maxlength="10">
</div>
</div>
<div class="form-group">
<label for="inputqualification"><img class="image" src="Image/quali.png"
alt="image">Qualifications:</label>
<select class="form-control" id="inputqualification">
<option>Graduation</option>
<option>Higher Secondary</option>
<option>Matriculation Pass</option>
<option>Diploma</option>
</select>
</div>
<div class="form-group">
<div class="mt-2">
<label for="inputcode">Upload Image</label>
<div class="custom-file ">
<input type="file" class="custom-file-input" id="file" onfocus="imageval()">
<label class="custom-file-label" for="validatedCustomFile">Choose image...</label>
<div class="invalid-feedback"> Invalid image </div>
</div>
</div>
<div class="form-group mb-5">
<label class="" for="file"> <img class="image" src="Image/file.png" alt="image">Select an image
(max size 2MB):</label>
<input type="file" id="file" accept=".jpeg,.jpg,.png" class="form-control form-control-lg"
onfocus="imageval()" required>
</div>
<div class="mt-2">
<label for="inputcode">Upload File</label>
<div class="custom-file ">
<input type="file" class="custom-file-input" id="validatedfile" >
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback"> Invalid file </div>
</div>
</div>
</div>
<div class="form-group mb-5">
<label for=""> <img class="image" src="Image/file.png" alt="image"> Select a document (max size
5MB):</label>
<input class="form-control form-control-lg" type="file" id="doc" name="document"
accept=".pdf, .doc, .docx" maxlength="5000000" onkeyup="docval()" required>
<span id="errd"></span>
</div>
<div class="form-group">
<label for="address"><img class="image" src="Image/address.png" alt="image">Address:</label>
<textarea class="form-control" id="address" rows="3" onkeyup="addr()"></textarea>
<p id="sms7" class="text-warning"></p>
</div>
<div class="form-group mt-2">
<div class="captcha">
<img class="image" src="Image/captcha.png" alt="image">
<input type="text" id="captcha-input" placeholder="Enter the code above"
onreset="refreshCaptcha()" />
<img src="" alt="CAPTCHA code" id="captcha-img" />
<button type="button" onclick="refreshCaptcha()">Refresh</button>
</div>
<div id="captcha-feedback"></div>
</div>
<div class="row">
<div class="col-auto">
<button type="submit" style="width: 150px;height: auto;"
class="btn btn-info btn-lg mt-2 mb-2">Submit</button>
</div>
<div class="col-auto">
<button type="submit" style="width: 150px;height:auto;"
class="btn btn-info btn-lg mt-2 mb-2">Reset</button>
</div>
</div>
</form>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
</body>
<script>
window.onload = function () {
refreshCaptcha();
}
const firstName = document.getElementById("inputfname");
const lastName = document.getElementById("inputlname");
firstName.addEventListener("keydown", function (event) {
if (firstName.selectionStart === 0 && event.keyCode === 32) {
event.preventDefault();
}
});
lastName.addEventListener("keydown", function (event) {
if (lastName.selectionStart === 0 && event.keyCode === 32) {
event.preventDefault();
}
});
inputemail.addEventListener('keydown', function (e) {
// // Check if the first character is a whitespace and prevent it
if (inputemail.selectionStart === 0 && e.key === ' ') {
e.preventDefault();
return false;
}
});
pass1.addEventListener('keydown', function (e) {
// // Check if the first character is a whitespace and prevent it
if (pass1.selectionStart === 0 && e.key === ' ') {
e.preventDefault();
return false;
}
});
pass2.addEventListener('keydown', function (e) {
// // Check if the first character is a whitespace and prevent it
if (pass2.selectionStart === 0 && e.key === ' ') {
e.preventDefault();
return false;
}
});
inputdob.addEventListener('keydown', function (e) {
// // Check if the first character is a whitespace and prevent it
if (inputdob.selectionStart === 0 && e.key === ' ') {
e.preventDefault();
return false;
}
});
// address1.addEventListener('keydown', function(e) {
//Check if the first character is a whitespace and prevent it
// if (address1.selectionStart === 0 && e.key === ' ') {
// e.preventDefault();
// return false;
// }
// });
const addressField1 = document.querySelector('#address');
function addWhiteSpace(element) {
const address = element.value;
let formattedAddress = '';
let count = 0;
for (let i = 0; i < address.length; i++) {
if (count > 0 && count % 16 === 0) {
if (address[i] !== ' ') {
formattedAddress += ' ';
}
}
formattedAddress += address[i];
if (address[i] !== ' ') {
count++;
} else {
count = 0;
}
}
element.value = formattedAddress;
}
addressField1.addEventListener('input', function () {
addWhiteSpace(addressField1);
});
const form = document.getElementById("validateLanguageKnown");
form.addEventListener("submit", function (event) {
event.preventDefault();
const isValid = validateLanguageKnown();
if (isValid) {
form.submit();
}
});
</script>
</html>