-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.html
247 lines (204 loc) · 8.09 KB
/
registration.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Registration</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
function validate()
{
if( document.registration.firstname.value == "" )
{
alert( "Please provide your name!" );
document.registration.firstname.focus() ;
return false;
}
if( document.registration.email.value == "" )
{
alert( "Please provide your Email!" );
document.registration.email.focus() ;
return false;
}
if( document.registration.lastname.value == "" )
{
alert( "Please provide your lastname!" );
document.registration.lastname.focus() ;
return false;
}
if( document.registration.date.value == "" )
{
alert( "Please provide your date!" );
document.registration.date.focus() ;
return false;
}
if( document.registration.password.value == "" )
{
alert( "Please provide your password!" );
document.registration.password.focus() ;
return false;
}
if( document.registration.password2.value == "" )
{
alert( "Please Confirm the password!" );
document.registration.password2.focus() ;
return false;
}
if( document.registration.username.value == "" )
{
alert( "Please provide your username!" );
document.registration.username.focus() ;
return false;
}
if (document.registration.password.value.length >16 )
{
alert("Password must be less than 16");
return false;
}
if (document.registration.password.value.length <5 )
{
alert("Password must be greater than 5");
return false;
}
if (document.registration.password.value != document.registration.password2.value )
{
alert("Passwords don't match");
return false;
}
re = /[a-zA-Z]/;
if(!re.test(registration.firstname||lastname.value)) {
alert("Error: firstname and lastname must contain only letters!");
registration.firstname.focus();
return false;
}
re = /[a-z]/;
if(!re.test(registration.password.value)) {
alert("Error: password must contain at least one lowercase letter (a-z)!");
registration.password.focus();
return false;
}
re = /[A-Z]/;
if(!re.test(registration.password.value)) {
alert("Error: password must contain at least one uppercase letter (A-Z)!");
registration.password.focus();
return false;
}
re = /[0-9]/;
if(!re.test(registration.password.value)) {
alert("Error: password must contain at least one number (0-9)!");
registration.password.focus();
return false;
}
re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
if(registration.date.value != '' && !registration.date.value.match(re)) {
alert("Invalid date format: " + registration.date.value);
registration.date.focus();
return false;
}
re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!re.test(registration.email.value)) {
alert('Please provide a valid email address');
registration.email.focus();
return false;
}
return true;
}
</script>
</head>
<style>
body {
margin: 0;
background: url('images/arka.jpg');
background-size: cover;
background-repeat:no-repeat;
display: compact;
display: compact;
}
.icon-bar{ background-color: #A52A2A;}
</style>
<body >
<div class="container-fluid">
<br>
<div class = "navbar-header">
<button type = "button" class = "navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class = "collapse navbar-collapse" id = "navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="home.html"><span class="glyphicon glyphicon-home"></span>Home</a></li>
<li><a href="aboutme.html"><span class="glyphicon glyphicon-question-sign"></span>About Me</a></li>
<li><a href="historicalplaces.html"><span class="glyphicon glyphicon-picture"></span>Historical Places</a></li>
<li><a href="localdishes.html"><span class="glyphicon glyphicon-book"></span>Local Dishes</a></li>
<li><a href="usefullinks.html"><span class="glyphicon glyphicon-info-sign"></span>Useful Links</a></li>
<li><a href="registration.html"><span class="glyphicon glyphicon-info-sign"></span>Registration</a></li>
<li><a href="contactme.html"><span class="glyphicon glyphicon-share"></span>Contact Me</a></li>
</ul>
</div>
<br><br><br>
<div class="jumbotron">
<h2 align="center">Registration</h2>
<article align="center">
<form method="post" name="registration" action="calculator.html" onsubmit ="return (validate());" >
<fieldset>
<legend><strong>USER INFORMATIONS</strong></legend>
First Name..........:
<input type="text" name="firstname">
<br>
Last Name..........:
<input type="text" name="lastname">
<br>
Date Of Birth.......:
<input type="date" name="date">
<br>
E-mail Address...:
<input type="email" name="email">
<br>
User Name..........:
<input type="text" name="username">
<br>
Password............:
<input type="password" name="password" />
<br>
Confirm Password:
<input type="password" name="password2">
<br>
Gender:
<select name="select">
<option>Male</option>
<option>Female</option>
</select>
<br>
Interest: <br>
<input type="checkbox" name="interest" value=""/>read<br>
<input type="checkbox" name="interest" value=""/>photography<br>
<input type="checkbox" name="interest" value=""/>travel<br>
<input type="checkbox" name="interest" value=""/>sports<br>
<input type="checkbox" name="interest" value=""/>animals<br>
<input type="checkbox" name="interest" value=""/>videogames<br>
<input type="checkbox" name="interest" value=""/>music<br>
<input type="checkbox" name="interest" value=""/>bike<br>
<input type="checkbox" name="interest" value=""/>code<br>
<input type="checkbox" name="interest" value=""/>swim
<br>
<input type="submit" value="sumbit" href="calculator.html" />
<input type="reset" value="reset"/>
</fieldset>
</form>
</article>
</div>
</div>
</body>
</html>