-
Notifications
You must be signed in to change notification settings - Fork 0
/
rcb.js
283 lines (246 loc) · 6.12 KB
/
rcb.js
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
var un,p2,sun,phone,cell,db,e,n,p,cp=false;
var d1,d2,d3,d4,d5,d6;
window.onload=function()
{
var myimage=document.getElementById("slideim");
var imarr=["img/r10.jpg","img/r9.png","img/r8.jpg","img/r2.jpg","img/r3.jpg",
"img/r4.png","img/r5.jpg","img/r6.jpg","img/r7.jpg","img/r1.jpeg"];
var i=0;
setInterval(function(){
myimage.setAttribute("src",imarr[i]);
i++;
if(i>=imarr.length){i=0;}
},1500);
showHob();
document.getElementById("login").style.display="none";
document.getElementById("signup").style.display="none";
document.getElementById("details").style.display="none";
check();
vaLog();
};
function details()
{
document.getElementById("details").style.display="block";
document.getElementById("signup").style.display="none";
document.getElementById("d1").innerHTML=d1;
document.getElementById("d2").innerHTML=d2;
document.getElementById("d3").innerHTML=d3;
document.getElementById("d4").innerHTML=d4;
document.getElementById("d5").innerHTML=d5;
document.getElementById("d6").innerHTML=d6;
}
function showLog()
{
document.getElementById("login").style.display="block";
document.getElementById("signup").style.display="none";
}
function showSign()
{
document.getElementById("signup").style.display="block";
document.getElementById("login").style.display="none";
}
function showHob()
{
document.getElementById("hobbies").onclick=function()
{
if(document.getElementById("hobbies").checked)
{
document.getElementById("hlist").style.display="block";
}
else
{
document.getElementById("hlist").style.display="none";
}
};
document.getElementById("hlist").style.display="none";
}
function vaUn()
{
var pat = /^[a-zA-Z_0-9]{6,40}$/;
var name= document.getElementById('Un');
if (pat.test(name.value))
{
document.getElementById("err").innerHTML="CORRECT";
un=true;
return true;
}
else
{
document.getElementById("err").innerHTML="INVALID USERNAME";
un=false;
return false;
}
}
function vaLpass()
{
var pat = /^(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
var pass= document.getElementById('Lpass');
if (pat.test(pass.value))
{ document.getElementById("err").innerHTML="CORRECT";
p2=true;
return true;
}
else
{
document.getElementById("err").innerHTML="INVALID PASSWORD";
p2=false;
return false;
}
}
function vaLog()
{ document.getElementById("log").onsubmit=function()
{
if( un==true && p2==true)
{
alert("Login Successful");
return true;
}
else
{
alert("PLEASE ENTER ALL DETAILS");
return false;
}
};
}
function vaSnam()
{
var pattern = /^[a-zA-Z.]{6,30}$/;
var name= document.getElementById('Snam');
if (pattern.test(name.value))
{ d1=name.value;
document.getElementById("serr").innerHTML="CORRECT";
n=true;
return true;
}
else
{
document.getElementById("serr").innerHTML="INVALID NAME";
n=false;
return false;
}
}
function vaSUnam()
{
var pat = /^[a-zA-Z_0-9]{6,40}$/;
var Sun= document.getElementById('Sun');
if (pat.test(Sun.value))
{
d2=Sun.value;
document.getElementById("serr").innerHTML="CORRECT";
sun=true;
return true;
}
else
{
document.getElementById("serr").innerHTML="INVALID USERNAME";
sun=false;
return false;
}
}
function vaSpas()
{
var pat = /^(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
var pass= document.getElementById('Spas');
if (pat.test(pass.value))
{
document.getElementById("serr").innerHTML="CORRECT";
p=true;
return true;
}
else
{
document.getElementById("serr").innerHTML="INVALID PASSWORD";
p=false;
return false;
}
}
function vaScpas()
{
var Spas= document.getElementById('Spas');
var Scpas= document.getElementById('Scpas');
if(Spas.value==Scpas.value)
{ document.getElementById("serr").innerHTML="MATCH";
cp=true;
return true;
}
else
{
document.getElementById("serr").innerHTML="NOT MATCH";
cp=false;
return false;
}
}
function vaSema()
{
var ema = document.getElementById('Sema');
var pat = /^[a-zA-Z0-9._-]+@[a-zA-Z]+\.[a-zA-Z]{2,6}$/;
if (pat.test(ema.value))
{ d3=ema.value;
document.getElementById("serr").innerHTML="CORRECT";
e=true;
return true;
}
else
{ document.getElementById("serr").innerHTML="INVALID EMAIL";
e=false;
return false;
}
}
function vaSph()
{
var pat=/^[0-9]{3}-[0-9]{8}$/;
var ph=document.getElementById("Sph");
if(pat.test(ph.value))
{ d4=ph.value;
document.getElementById("serr").innerHTML="CORRECT";
phone=true;
}
else{
document.getElementById("serr").innerHTML="INVLAID PHONE";
phone=false;
}
}
function vaScel()
{
var pat=/^\+[0-9]{2}-[0-9]{10}$/;
var cel=document.getElementById("Scel");
if(pat.test(cel.value))
{d5=cel.value;
document.getElementById("serr").innerHTML="CORRECT";
cell=true;
}
else {
document.getElementById("serr").innerHTML="INVALID CELL NO";
cell=false;
}
}
function vadob()
{
var pat=/^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/;
var dob=document.getElementById("dob");
if(pat.test(dob.value))
{ d6=dob.value;
document.getElementById("serr").innerHTML="CORRECT";
db=true;
}
else
{ document.getElementById("serr").innerHTML="INVALID DOB";
db=false;
}
}
function check()
{
document.getElementById("signup").onsubmit=function()
{
if(e==true&&n==true&&p==true&&cp==true&&phone==true&&cell==true&&db==true)
{
details();
return false;
}
else
{
alert("PLEASE ENTR ALL DETAILS");
return false;
}
};
}