+ 1
How do i set minimum number of text in a form.
How
4 Antworten
+ 1
What about if i want it to be at least 5 characters
+ 2
<input type="text" maxlength="5"/>
You can set maximum length that input can accept using maxlength attribute which the input tag accepts only that particular characters
+ 2
You can use the pattern attribute with a regular expression to validate input with.
i.e.
<input pattern=”[A-Za-z]{5,}”/>
This pattern allows A-Z and doesnt validate unless there are atleast 5 characters.
For more, read up on regular expressions.
Hope it helped.
0
<input type="number" min="5" max="8">
You can aslo set minimum characters to be accepted by using above example