Skip to content

Commit 1d75fb5

Browse files
committed
Input tips, Updated the index.html file
1 parent c062388 commit 1d75fb5

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

Diff for: inputs/index.html

+34-6
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,42 @@ <h2>E-mail</h2>
6868
<h2>Regex validations</h2>
6969
<form>
7070
<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>
7674
<button type="submit"> Test </button>
7775
</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+
79107
</div>
80108
</body>
81109

0 commit comments

Comments
 (0)