Currently, I am attempting to develop a new input function that will reject any number entered by the user if it exceeds a specified limit. However, I have encountered some issues with this.
Let's assume the maximum allowed number is 99
. Currently, my approach involves creating something along these lines:
<input
type="text"
:maxlength="2"
aria-controls="none"
class="number-field-input"
inputmode="numeric"
pattern="/d+"
v-model="inputOne"
/>
By setting the maxlength to 2
, this effectively limits the maximum allowed number to 99
. However, this method is not ideal and does not work as intended. I am looking for an alternative solution like the following:
<input
type="number"
min="1"
max="99" //could be any value between 1 and 99
aria-controls="none"
class="number-field-input"
inputmode="numeric"
pattern="/d+"
v-model="inputOne"
/>