-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathregistration.html
More file actions
408 lines (347 loc) · 15 KB
/
registration.html
File metadata and controls
408 lines (347 loc) · 15 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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html>
<head>
<title>STUDENT REGISTRATION FORM</title>
<script>
<!-- Function to validate the form -->
function submitForm()
{
document.myForm.target = "_blank";
window.open("payment.html"); <!-- Opens payment.html file on complete validation -->
document.myForm.submit();
}
function validateForm()
{
let x = document.forms["myForm"]["fname"].value;
document.forms["myForm"]["fname"].style.borderColor = "red";
<!-- Checks if the value in first name field is null -->
if (x == "") {
alert("Name must be filled out");
return false;
}
else{
<!-- Changes the border colour of the field to green on valid entry to enhance user visibility -->
document.forms["myForm"]["fname"].style.borderColor = "green";
<!-- Checks the @ and . position and characters entered before and after them to look for a valid email id -->
var y=document.forms["myForm"]["Email_ID"].value;
var atposition=y.indexOf("@");
var dotposition=y.lastIndexOf(".");
if (atposition<1 || dotposition<atposition+2 || dotposition+2>=y.length){
alert("Please enter a valid e-mail address \n atpostion:"+atposition+"\n dotposition:"+dotposition);
return false;
}
else{
<!-- Regex used to validate phone number, should contain 10 digits and should not start from 0 -->
var phoneno = /^\d{10}$/;
if(phone_no.value.match(phoneno)){
<!-- Regex used to check a pin code, First digit can vary from 1 to 9 whereas the next 5 digits can be any number from 0 to 9 -->
var a = /^[1-9][0-9]{5}$/;
if (pin.value.match(a))
{
return submitForm();
}
else
{
alert("Your Entered Zip Code Is Not Valid.")
}
}
else
{
alert("Please enter a valid 10 digit phone number");
return false;
}
}
}
}
</script>
<style>
input[type=text] {
width: 100%;
padding: 10px 0;
background: none;
border: none;
border-bottom: 1px solid #666;
color: #ddd;
font-size: 14px;
text-transform: uppercase;
outline: none;
transition: border-color .2s;
}
input[type=text]::placeholder {
color: #666;
}
input[type=text]:focus {
border-bottom-color: #ddd;
}
input[type=email] {
width: 100%;
padding: 10px 0;
background: none;
border: none;
border-bottom: 1px solid #666;
color: #ddd;
font-size: 14px;
outline: none;
transition: border-color .2s;
}
input[type=email]::placeholder {
color: #666;
}
input[type=email]:focus {
border-bottom-color: #ddd;
}
/*Buttons*/
input[type=submit],
input[type=reset] {
background-color: #4d4d4d;
border: none;
color: white;
padding: 10px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}
<!-- Hovering effects(when cursor is moved over the submit button) -->
input[type=submit]:hover {
color: black;
}
<!-- Hovering effects(when cursor is moved over the reset button) -->
input[type=reset]:hover {
color: black;
}
input[type=date] {
border: 1px solid #666;
background-color: #666;
border-radius: 7px;
padding: 4px 8px;
}
input[type=file] {
border: 1px solid #666;
background-color: #666;
border-radius: 7px;
padding: 5px;
}
input[type=number] {
border: 1px solid #666;
background-color: #666;
border-radius: 7px;
padding: 5px;
color: white;
outline: none;
width: 50px;
text-align: center;
}
#table1 {
border-radius: 25px;
background:rgb(248,248,255,0.9);
padding: 20px;
width: 1000px;
height: 500px;
}
#table2 {
background:rgb(0, 0, 204,0.1);
padding: 20px;
border: 1px solid ghostwhite;
border-collapse: collapse;
border-radius: 17px;
}
td {
padding: 20px;
}
#c1 {
color: #000099;
border: blue;
border-color: blue;
border-block-color: blue;
}
body {
background: linear-gradient(to right, #ea1d6f 0%, #eb466b 100%);
font-size: 15px;
}
#title {
text-align: center;
color: #000099;
border-bottom: 3px solid #000099;
}
#dropdown {
background-color: ghostwhite;
color: black;
border-radius: 7px;
padding: 8px;
width: 200px;
border: 1px;
font-size: 15px;
border-color: blue;
}
</style>
</head>
<body style="background-image: url('https://wallpapercave.com/wp/wp3102516.jpg');">
<!-- Usage of marquee tool to enable scrolling of the form title -->
<marquee scrollamount="10"><img src="Reminiscence.png"></marquee>
<center>
<!-- Validation of form using javascript on submission-->
<form name="myForm" onsubmit="return validateForm()" method="POST">
<!-- Creation of form inside a table to enhance the look and structure of the form-->
<table id="table1" bgcolor="white">
<tr>
<td colspan="3">
<h1 id='title'>STUDENT REGISTRATION FORM</h1>
</td>
</tr>
<tr>
<!-- Usage of appropriate placeholders to inform the user as to what value has to be entered-->
<td style="width:12px;"> </td>
<td id='c1'>FIRST NAME:</td>
<td><input style="color: black;" type="text" name="fname" placeholder="First Name"</td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>LAST NAME:</td>
<td><input style="color: black;" type="text" name="lname" placeholder="Last Name"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>DATE OF BIRTH:</td>
<!-- Usage of min and max attribute to limit the entries in accordance with the college ages-->
<td><input style="color: black;" type="date" name="date" min="01-04-1998" max="01-04-2020"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>EMAIL ID:</td>
<td><input style="color: black;" type="text" name="Email_ID" placeholder=EMAIL ></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>MOBILE NUMBER:</td>
<td><input style="color: black;" type="text" id="phone_no" placeholder="10 digits number"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>COLLEGE NAME:</td>
<td><input style="color: black;" type="text" name="college"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>GENDER:</td>
<!-- Usage of nbsp(non-breaking spaces for proper alignment of the form-->
<td style="color: black;"><input type="radio" name="gender" value="male"> MALE
<input type="radio" name="gender" value="Female"> FEMALE
<input type="radio" name="gender" value="Prefer not to say"> PREFER NOT TO SAY
</td>
</tr>
<tr>
<!-- FILE input used to obtain the user photo-->
<td style="width:12px;"> </td>
<td id='c1'>UPLOAD PHOTO:</td>
<td><input id="img" type="file" name="photo"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>CITY:</td>
<td><input style="color: black;" type="text" name="city"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>PIN CODE:</td>
<td><input style="color: black;" type="text" id="pin"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>STATE:</td>
<td><select id="dropdown" name="state">
<option>Select</option>
<option>Coimbatore</option>
<option>Chennai</option>
<option>Bangalore</option>
<option>Kerala</option>
</select></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>COUNTRY:</td>
<!-- Usage of readonly attribute to prevent the user from altering the value-->
<td><input style="color: black;" type="text" name="country" value="India" readonly="readonly"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>EVENTS:</td>
<td>
<table id="table2">
<tr>
<td>1</td>
<td>Fun Fair</td>
<td> <input type="checkbox" id="shipwreck" name="shipwreck" value="shipwreck">
<label for="vehicle1"> Shipwreck </label><br>
</td>
<td> <input type="checkbox" id="ee sala cup namde" name="ee sala cup namde"
value="ee sala cup namde">
<label for="vehicle1"> Ee sala cup namde </label><br>
</td>
<td> <input type="checkbox" id="block & tackle" name="block & tackle"
value="block & tackle">
<label for="vehicle1">Block and Tackle</label><br>
</td>
</tr>
<tr>
<td>2</td>
<td>Theatrics</td>
<td><input type="checkbox" id="movierev" name="movierev" value="movierev">
<label for="vehicle1">Movie Review</label><br>
</td>
<td><input type="checkbox" id="photography" name="photography" value="photography">
<label for="vehicle1">Photography</label><br>
</td>
<td><input type="checkbox" id="tunes" name="tunes" value="tunes">
<label for="vehicle1">Adapt Tunes</label><br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>SPECIAL TEAM EVENTS:</td>
<td style="color:black;"><input type="radio" name="course"> ADZAP
<input type="radio" name="course"> BAND
<input type="radio" name="course"> FIFA
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>TEAM NAME:</td>
<td><input style="color: black;" type="text" name="tname" placeholder="Team Name"></td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>TEAM LEADER:</td>
<td><input style="color: black;" type="text" name="tleader" placeholder="Team Leader"></td>
</tr>
<tr>
<td style="width:12px;"></td>
<td id='c1'>NO. OF TEAM MEMBERS:</td>
<td><label for="tmembers"></label>
<input style="color: black;" type="number" id="tmembers" name="tmembers" min="3" max="6">
</td>
</tr>
<tr>
<td style="width:12px;"> </td>
<td id='c1'>TEAM MEMBERS:</td>
<td>
<ul>
<li><input style="color: black;" type="text" name="member1" placeholder="Member 1"></li>
<li><input style="color: black;" type="text" name="member2" placeholder="Member 2"></li>
<li><input style="color: black;" type="text" name="member3" placeholder="Member 3"></li>
<li><input style="color: black;" type="text" name="member4" placeholder="Member 4"></li>
<li><input style="color: black;" type="text" name="member5" placeholder="Member 5"></li>
<li><input style="color: black;" type="text" name="member6" placeholder="Member 6"></li>
</ul>
</td>
</tr>
</table><br>
<div>
<input type="submit">
<input type="reset" name="reset">
</div>
</form>
</body>
</html>