-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
100 lines (86 loc) · 2.38 KB
/
index.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
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<title>Test Enterprisesqw</title>
<head>
<style type="text/css">
.error{
color: #FF0000;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<form>
<table border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td>Name</td>
<td><input type="text" id="textid" name="text1" value="" onBlur="getValid()"/></td>
<span class="error" id="text_valid"></span>
</tr>
<tr>
<td>Phone</td>
<td><input type="text" id="testForm12" name="tst12" value="" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" id="textAddress" name="addresss" value="" /></td>
</tr>
<tr>
<td>Details</td>
<td><input type="text" id="textDetails" name="Details" value="" /></td>
</tr>
<tr>
<td>Address Field</td>
<td><input type="text" id="testForm" name="tst12" value="" onBlur="getval()" /></td>
<span class="error" id="add_valid"></span>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value=""></td>
</tr>
<tr>
<td>alternate email</td>
<td><input type="text" name="altemail" value=""></td>
</tr>
<tr>
<td>Father Name</td>
<td><input type="text" name="fname" value=""></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="submit" /></td></tr>
</table>
</form>
</body>
</html>
</head>
<body>
</body>
<script>
function isEmpty(str){
return !str.replace(/\s+/, '').length;
}
function getValid(){
//alert("test");
var text=document.getElementById('textid').value;
if(isEmpty(text)){
document.getElementById("text_valid").innerHTML = "Enter Text";
document.getElementById("textid").focus();
}
else{
document.getElementById("text_valid").innerHTML = "";
}
}
function getval(){
//alert("test");
var text=document.getElementById('testForm').value;
if(isEmpty(text)){
document.getElementById("add_valid").innerHTML = "Enter Address";
document.getElementById("testForm").focus();
}
else{
document.getElementById("testForm").innerHTML = "";
}
}
</script>
</html>
</html>