Reputation: 385
My regex works fine on regex101 and my regex is
[1-4]|(0)
But when I tried it on HTML input element's attribute it doesn't work as expected. My HTML is like below
<form action="/">
<input type="text" id="usernum" name="usernum" pattern="[1-4]|(0)" title="1-4 and must include at leat one 0">
<input type="submit">
</form>
I want users must enter one 0 along with the ranges digit.
Upvotes: 0
Views: 27