forked from AnubhavDutta/KIITFEST6FULL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
74 lines (51 loc) · 1.44 KB
/
script.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
function isInputNumber(evt){
var ch = String.fromCharCode(evt.which);
if(!(/[0-9]/.test(ch))){
evt.preventDefault();
}
}
function isNotChar(evt){
var ch = String.fromCharCode(evt.which);
if(ch=="'"){
evt.preventDefault();
}
}
function blockSpecialChar(e){
var k;
document.all ? k = e.keyCode : k = e.which;
return ((k >= 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 46|| k == 42|| k == 33 || k == 32 || (k >= 48 && k <= 57));
}
function checkmodalform(theform){
var email = theform.acmail.value;
var pw=theform.acpw.value;
var cpw=theform.accpw.value;
if (!validateEmail(email)) {
alert("Invalid Email address");
return false;
}
if(pw!=cpw){
alert("Passwords Do Not Match\n");
itssubmitted=0;
return false;
}
return true;
}
function checkfullform(theform){
var contact= theform.accontact.value/1000000000;
var whatsapp= theform.acwhatsapp.value/1000000000;
if(contact<1||contact>10){
alert(" Please enter a valid contact number\n");
itssubmitted=0;
return false;
}
if(whatsapp<1||whatsapp>10){
alert(" Please enter a valid Whatsapp number\n");
itssubmitted=0;
return false;
}
return true;
}
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}