Reputation: 13
I am using the input pattern on my register form which consists of a Username, Email and Password.
I have set the Username between 5 and 15 characters however when this has been typed correctly and I go to submit the form I am not able to submit, but instead still receive the required title message. Anyone any ideas?
<div class="col-sm-offset-2 col-sm-9"><td><input pattern=".{5, 15}" required title="Username should be between 5 - 15 characters"type="text" class="form-control" name="uname" placeholder="User Name" required/></td> </div>
Upvotes: 0
Views: 110
Reputation: 943510
You must remove the space. Compare the explanations from https://regex101.com/
/.{5, 15}/
.
matches any character (except newline){5, 15}
matches the characters {5, 15} literallyand
/.{5,15}/
.{5,15}
matches any character (except newline)- Quantifier:
{5,15}
Between 5 and 15 times, as many times as possible, giving back as needed [greedy]
Upvotes: 1