-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidation.html
142 lines (73 loc) · 3.17 KB
/
validation.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<html>
<head>
<title>Validation</title>
<meta charset = "UTF-8" />
<script src="validation.js">
</script>
<style>
body{
background: -webkit-gradient(linear, left top, right top, from(#1a82f7), to(#2F2727));
text-align: left;
}
#container{
background-color: azure;
padding: 20px 20px 100px 20px;
width: 700px;
}
p{
font-weight: 100;
font-family: sans-serif;
font-style: normal;
}
input[type="text"],[type="password"]{
border: 5px solid black;
border-radius: 10px;
text-align: justify;
}
td{
padding:15px;
}
</style>
</head>
<body>
<div id="container">
<form name="validation" id="validation1" onsubmit="return validate()">
<table>
<tr>
<td><p>Enter Name: </p></td><td><input type="text" id="name" name="name1" size="20" title="enter the name less than 15 characters" autofocus /></td>
</tr>
<tr>
<td><p>User Name:</p></td> <td><input type="text" id="uname" name="uname1" size="20" title="should be in lower case and without space and 1 number should be added" pattern= "(?=.*\d)(?=.*[a-z]).{5,}" /> </td>
</tr>
<tr>
<td> <p>Email address:</p></td><td> <input type="text" id="mail" name="mail1" size=20 autocomplete="on" title="enter the valid mail"/> </td>
</tr>
<tr><td> <p>Password: </p></td><td><input type="password" id ="password" name="password1" size=20 autocomplete="on" title="should be with 1 uppercase letter and 1 lowercaseletter and 1 number should be added and min words should be 8" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"/> </td>
</tr>
<tr>
<td> <p>Confirm Password: </p></td><td><input type="password" id ="password2" name="password3" autocomplete="on" title="type the same password as in above field"/> </td>
</tr>
<tr>
<td><p> <label for="date"> Birthday: </label> </p></td><td><input type="date" id="date" name="date1" min="1990-01-22" title="minimum age should be 18" /></td>
</tr>
<tr>
<td> <label for="sub">Major Subjects:</label></td><td> <select id="sub">
<option value="Physics" selected> physics</option>
<option value="maths" > Maths</option>
<option value="Chemistry" >chemistry </option>
</select></td>
</tr>
<tr>
<td><p>Percentage Range: </p></td><td><input type="number" id="percentage" name="percentage1" min="0" max="100" /> </td></tr>
<tr>
<td>
<p>country code</p></td><td><input type=text id ="country" name="country1" pattern="[0-9]{6}" /></td></tr>
<tr>
<td>
<input type="submit" value="submit" /></td>
<td> <input type="reset" /></td>
</tr>
</table>
</form>
</div></body>
</html>