-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactus.js
executable file
·53 lines (38 loc) · 1.14 KB
/
contactus.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
function checkData ()
{
if (document.signup.NAME.value == "")
{
alert("Please fill in your name.")
document.signup.NAME.focus()
return false
}
if (document.signup.NAME.value.length < 3)
{
alert("Name cannot be less than three characters.")
document.signup.NAME.focus()
return false
}
if (document.signup.EMAIL.value =="")
{
alert("Please fill in your email address.")
document.signup.EMAIL.focus()
return false;
}
var x=document.forms["signup"]["EMAIL"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
if (document.signup.COMMENTS.value =="")
{
alert("Please type in a message.")
document.signup.COMMENTS.focus()
return false;
}
else {
return true;
}
}