@@ -68,14 +68,42 @@ <h2>E-mail</h2>
68
68
< h2 > Regex validations</ h2 >
69
69
< form >
70
70
< label for ="password "> Strong password($Password1234):</ label >
71
- < input type ="password "
72
- name ="password "
73
- id ="password "
74
- placeholder ="6-20 chars, at least 1 digit, 1 uppercase and one lowercase letter "
75
- pattern ="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$ " autofocus required >
71
+ < input type ="password " name ="password " id ="password "
72
+ placeholder ="6-20 chars, at least 1 digit, 1 uppercase and one lowercase letter "
73
+ pattern ="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$ " autofocus required >
76
74
< button type ="submit "> Test </ button >
77
75
</ form >
78
- </ div >
76
+ </ div >
77
+
78
+ < div class ="box ">
79
+ < h2 > Allow only integer</ h2 >
80
+ < form >
81
+ < label for ="intfield "> Allow only integer</ label >
82
+ < input id ="intfield " type ="text " onkeypress ='return event.charCode >= 48 && event.charCode <= 57 ' maxlength ="10 ">
83
+ </ form >
84
+ </ div >
85
+
86
+ < div class ="box ">
87
+ < h2 > Mobile Number validation using Regex (Allow only the phone number which starts with 7,8 and 9)</ h2 >
88
+ < form >
89
+ < label for ="mobilenumbervalidation "> Mobile Number</ label >
90
+ < input id ="mobilenumbervalidation " type ="text " pattern ="[789][0-9]{9} " autofocus required >
91
+ < button type ="submit "> Test </ button >
92
+ </ form >
93
+ </ div >
94
+
95
+
96
+ < div class ="box ">
97
+ < h2 > Full Name Validation</ h2 >
98
+ < form >
99
+ < label for ="fullnamevalidationid "> Full Name</ label >
100
+ < input id ="fullnamevalidationid " type ="text " name ="fullName " onkeypress ="return (event.charCode > 64 &&
101
+ event.charCode < 91) || (event.charCode > 96 && event.charCode < 123) " placeholder ="Full Name ">
102
+ < button type ="submit "> Test </ button >
103
+ </ form >
104
+ </ div >
105
+
106
+
79
107
</ div >
80
108
</ body >
81
109
0 commit comments