-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.html
92 lines (86 loc) · 2.27 KB
/
validate.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale =1.0">
<title>Document</title>
</head>
<script>
function validate()
{
var name = document.forms["RegForm"]["Name"];
var email = document.forms["RegForm"]["EMail"];
var phone = document.forms["RegForm"]["Telephone"];
var what = document.forms["RegForm"]["Subjec"];
var password = document.forms["RegForm"]["Password"];
var address = document.forms["RegForm"]["Address"];
if(name.value =="")
{
window.alert("Please enter your name.");
name.focus();
return false;
}
if(address.value =="")
{
window.alert("Please enter your address.");
address.focus();
return false;
}
if(email.value =="")
window.alert("Please enter a valid e-mail address.");
return false;
}
if(phone.value =="")
{
window.alert("please enter your telephone number.");
phone.focus();
return false;
}
if(password.value =="")
{
window.alert("Please enter your password");
return false;
}
if(what.selectedIndex<1)
{
window.alert("Please enter your course.");
what.focus();
return fale;
return true;
}
</script>
<style>
body
{
text-align:center;
}
</style>
</head>
<body>
<h1 style="text-align: center;">REGISTRATION FORM</h1>
<form name="RegForm" onsubmit="return validate()">
<p>Name:<input type="text"size="65" name="Name"/></p>
<br/>
<p>Address:<input type="text"size="65" name="Address"/></p>
<br/>
<p>E-Mail Address:<input type="text" size="65" name="EMail"/></p>
<br/>
</p>Password:<input type="text" size="65" name="password"/></p>
<br/>
<p>Telephone:<input type="text"size="65" name="Telephone"/></p>
<br/></p>
<select type="text" value="" name="Subject"><option>BTECH</option>
<option>BCA</option>
<potion>MCA</potion>
<option>MTECH</option>
</select>
</p>
<br/>
<input type="submit"value="Submit" name="Submit"/>
<input type=""reset value="Reset" name="Reset"/>
<p>
</p>
</form>
</body>
</body>
</html>