Here is my code:
$("input").inputmask("decimal", {
"radixPoint": ",",
"groupSeparator": " ",
"digits": 2,
"autoGroup": true,
"digitsOptional": true,
"suffix": " EUR",
"placeholder": "129,5",
"clearMaskOnLostFocus": false,
})
Everything works great but I don’t really understand how to display "129,5" as a placeholder instead of "1"?
Thanks in advance for your help!
I tried to search within StackOverflow and read the official documentation for jQuery.inputmask, but it didn’t help.
2
Answers
I looked through jQuery.inputmask source codes and understood that there's nothing to do about it so I had to find out different approach.
The docs for the inputmask plugin contain a section on Setting Initial Values.
It states that you just need to set the
value
attribute of the input.You could do this in HTML, ex:
<input value="129,5">
Alternatively, you could do it with jQuery: