-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidation1.html
More file actions
97 lines (80 loc) · 2.08 KB
/
validation1.html
File metadata and controls
97 lines (80 loc) · 2.08 KB
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
<html>
<head>
<script>
function test()
{
var name = document.getElementById("fname").value.trim();
if(name=="")
{
document.getElementById("fname").style.borderColor="red";
document.getElementById("nerror").innerHTML="Invalid name";
}
else
{
document.getElementById("fname").style.borderColor="green";
document.getElementById("nerror").innerHTML="";
}
var email=document.getElementById("email").value.trim();
if(email=="")
{
document.getElementById("email").style.borderColor="red";
document.getElementById("eerror").innerHTML="invalid Email";
}
else
{
document.getElementById("email").style.borderColor="green";
document.getElementById("eerror").innerHTML="";
}
var password=document.getElementById("password").value.trim();
if(password=="")||(
{
document.getElementById("password").style.borderColor="red";
document.getElementById("perror").innerHTML="invalid Email";
}
else
{
document.getElementById("password").style.borderColor="green";
document.getElementById("perror").innerHTML="";
}
}
</script>
</head>
<body>
<form>
<table align="center" cellpadding="5" cellspacing="5">
<tr>
<th>FullName</th>
<td> <input type="text" id="fname"></td>
<i id="nerror"></i>
</tr>
<tr>
<th>Email</th>
<td> <input type="text" id="email"></td>
<i id="eerror"></i>
</tr>
<tr>
<th>password</th>
<td> <input type="password" id="password" maxlength="8"></td>
<i id="perror"></i>
</tr>
<tr>
<th>conform password</th>
<td> <input type="password" id="cpassword" maxlength="8"></td>
<i id="cperror"></i>
</tr>
<tr >
<td>
<input type="radio" id="male" name="gender">Male
<input type="radio" id="female" name="gender">Female
<i id="gerror"></i>
</td>
<tr>
<th colspan="2">
<button type="button" onclick="test()">Submit
<button type="reset" onclick="clearall()">cancel
</th>
</tr>
</th>
</table>
</form>
</html>