-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.js
40 lines (30 loc) · 807 Bytes
/
form.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
function validateform() {
if (document.myform.Name.value=="") {
alert("Name must be filled out");
return false;
}
if (document.myform.College.value== "") {
alert( "Please provide your College name!" );
return false;
}
var emailID = document.myform.email.value;
atpos = emailID.indexOf("@");
dotpos = emailID.lastIndexOf(".");
if (atpos < 1 || ( dotpos - atpos < 2 )) {
alert("Please enter valid email ID")
return false;
}
if(document.myform.Pwd.value < 8) {
alert("Password must have atleast 7 characters");
return false;
}
return(true);
}
function clickbutton() {
if(validateform()==false) {
document.getElementById("button1").innerHTML="Ooops!!";
}
else {
document.getElementById("button1").innerHTML="Done";
}
}