-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHome.js.bak.bak
257 lines (176 loc) · 5.49 KB
/
Home.js.bak.bak
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
function accuracyLevel(){
document.getElementById("#accuracy_level").style["visibility"]=visible;
}
function login_validation(){
var username=document.getElementById("username");
var password=document.getElementById("password");
var username_error=document.getElementById("username_error");
var password_error=document.getElementById("password_error");
var status=true;
if(username.value==""){
username.style["border-bottom"]="1px solid red";
username_error.textContent="*required";
username_error.style.color="red";
username_error.style["font-size"]="12px";
status=false;
}
if(password.value==""){
password.style["border-bottom"]="1px solid red";
password_error.textContent="*required";
password_error.style.color="red";
password_error.style["font-size"]="12px";
status=false;
}
else{
username.style["border-bottom"]="1px solid black";
username_error.textContent="";
password.style["border-bottom"]="1px solid black";
password_error.textContent="";
}
return status;
}
function r_name(){
var name=document.forms["registrationform"]["register_name"];
var name_error=document.getElementById("name_error");
var status=1;
if(name.value==""){
name.style["border-bottom"]="1px solid red";
name_error.textContent="*required";
status=0;
}
else {
name.style["border-bottom"]="1px solid black";
name_error.textContent="";
document.getElementById('name_tick').setAttribute( "class", "fa fa-check" );
}
return 0;
}
function mail(){
var email=document.forms["registrationform"]["register_email"];
var email_error=document.getElementById("email_error");
var status=1;
if(email.value==""){
email.style["border-bottom"]="1px solid red";
email_error.textContent="*required";
status=0;
}
else if(email.value.indexOf("@")==-1){
email_error.style.color="red";
email_error.textContent="*Please Use @";
status=0;
}
else if(email.value.indexOf("@")<1){
email_error.style.color="red";
email_error.textContent="*Invalid Email-id";
status=0;
}
else if(email.value.indexOf(".")==-1){
email_error.textContent="*Please Use .";
status=0;
}
else if(email.value.indexOf("com")==-1){
email_error.textContent="*Please Use com";
status=0;
}
else if(email.value.indexOf(".com")!=email.value.length-4){
email_error.textContent="* Please Use .com correctly";
status=0;
}
else if(email.value.indexOf(".com")==(email.value.indexOf("@")+1)){
email_error.textContent="*Invalid Email-id";
status=0;
}
if(email.value.indexOf(".")!=-1&&email.value.indexOf("@")!=-1&&email.value.indexOf(".com")!=-1){
email.style["border-bottom"]="1px solid black";
email_error.textContent="";
document.getElementById('email_tick').setAttribute( "class", "fa fa-check" );
status=1;
}
return status;
}
function r_phoneno(){
var phoneno=document.forms["registrationform"]["register_phone"];
var phoneno_error=document.getElementById("phoneno_error");
var status=1;
if(phoneno.value==""){
phoneno.style["border-bottom"]="1px solid red";
phoneno_error.textContent="*required";
status=0;
document.getElementById('phone_tick').setAttribute( "class", "" );
}
else if(isNaN(phoneno.value)){
phoneno.style["border-bottom"]="1px solid red";
phoneno_error.textContent="*Enter Numeric Value only";
status=0;
document.getElementById('phone_tick').setAttribute( "class", "" );
}
else if(phoneno.value.length!=10){
phoneno.style["border-bottom"]="1px solid red";
phoneno_error.textContent="*Enter valid Mobile Number";
status=0;
document.getElementById('phone_tick').setAttribute( "class", "" );
}
else{
phoneno.style["border-bottom"]="1px solid black";
phoneno_error.textContent="";
document.getElementById('phone_tick').setAttribute( "class", "fa fa-check" );
}
return status;
}
function r_username(){
var username=document.forms["registrationform"]["register_username"];
var username_error=document.getElementById("username_error2");
var status=1;
if(username.value==""){
username.style["border-bottom"]="1px solid red";
username_error.textContent="*required";
status=0;
document.getElementById('username2_tick').setAttribute( "class", "" );
}
else if(username.value.length<8){
username.style["border-bottom"]="1px solid red";
username_error.textContent="*It must have minimum 8 characters";
document.getElementById('username2_tick').setAttribute( "class", "" );
}
else{
username.style["border-bottom"]="1px solid black";
username_error.textContent="";
document.getElementById('username2_tick').setAttribute( "class", "fa fa-check" );
}
return status;
}
function r_password(){
var password=document.forms["registrationform"]["register_password"];
var password_error=document.getElementById("password_error2");
var status=1;
if(password.value==""){
password.style["border-bottom"]="1px solid red";
password_error.textContent="*required";
status=0;
}
else if(password.value.length<8){
password.style["border-bottom"]="1px solid red";
password_error.textContent="*It must have minimum 8 characters";
status=0;
}
else{
password.style["border-bottom"]="1px solid black";
password_error.textContent="";
document.getElementById('password2_tick').setAttribute( "class", "fa fa-check" );
}
return status;
}
function registration_validation(){
var status=0;
var validate=false;
status+=r_name();
status+=mail();
status+=r_username();
status+=r_phoneno();
status+=r_password();
if(status==5){
validate=true;
}
return validate;
console.log("status"+status);
}