When using the "tel" attribute in an input, we can set a maximum or minimum length for the input. However, the drawback is that it allows for all types of inputs, whether numeric or alphabetic.
On the other hand, if we use the "number" attribute for the input, it only accepts numbers but we are unable to set a minimum or maximum character limit.
Even though I have specified a pattern within it, there is no change. Is there an alternative to achieve both setting a max-min length and accepting only numeric inputs?
<div class="form-group">
<label for="exampleFormControlInput3">Mobile Number</label>
<div class="input-group">
<span class="input-group-text" id="basic-addon1">+91</span>
<input type="tel" class="form-control" id="exampleFormControlInput3" maxlength="10" placeholder="012-345-6789" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">
</div>
</div>
https://i.sstatic.net/3gmxh.png
Note: Bootstrap 5 has been used for this implementation.