I have an input box in a form and I want user to enter number only and maxlength of the number should be 10.
<input type="text" maxlength="10" ng-model="phoneNumber" class="form-control"/>
When I use the method above, I can restrict the user with 10 digit but user can enter letter.
<input type="number" ng-model="phoneNumber" class="form-control"/>
When I use the second method, user can only enter numbers but I cannot restrict to enter only 10 digits.
Instead of warning the user, is there any other option by which I can combine these two attribute?