Open weiser21 opened 7 years ago
Same problem for me, i just need inputmask not to delete leading zeroes entered on some inputs with the numeric mask because they're not integer values just numeric values.
Just don't use the numeric alias for this. Use a Mask like 9{1,4} or something.
What about fixing this after more than a year? It's a main problem I'd say... Thanks.
@RobinHerbots - ran into this issue as well today. Birthday input, where user has to select the day of the month.
01 02 03 ...
@knoxcard, @jadamec ,
Something like
Inputmask("9{2}", {
placeholder: "0",
numericInput: true
}).mask("test2");
? What I'm missing here?
@knoxcard ,
Inputmask("datetime", {
inputFormat: "dd"
}).mask("test2");
For anyone else having this issue, I got this resolved with using input element of type text
along with inputMode numeric
PLUS having maskConfig as maskconfig: { groupSeparator: '', mask: '9{1,5}' }
, where I needed a 5 digit numeric input with allowed leading zeros.
Hope it helps!
In my case, there was a zero in my regex that I needed to put square brackets around. Its the first zero below.
new Inputmask({ regex: "\\d{4}-(0[0-9]|[1][0-2])-([0][0-9]|[1-2][0-9]|[3][0-1])", inputmode: "numeric" }).mask(dateElement.get(0))
to
`new Inputmask({
regex: "\\d{4}-([0][0-9]|[1][0-2])-([0][0-9]|[1-2][0-9]|[3][0-1])",
inputmode: "numeric"
}).mask(dateElement.get(0))`
in version 5.0.8-beta.20 this works for me
Inputmask('9{*}', {
inputmode: 'numeric',
placeholder: '',
rightAlign: false,
}).mask(...);
Is there a way to prevent leading zeros from being deleted when using inputmask? I use the below code to format 4 digit account numbers. Some account numbers have leading zeros which are being deleted as the user enters their information.