0
I created a mask using imaskjs for monetary value in an HTML input:
var element = document.getElementById("txtTeste");
var maskOptions = {
mask: Number,
scale: 2,
thousandsSeparator: ".",
padFractionalZeros: true,
normalizeZeros: true,
radix: ",",
mapToRadix: ["."],
min: -999999999.99,
max: 999999999.99
};
var mask = IMask(element, maskOptions);
Has some default value property for when the user enters a null value?
Place a check when leaving the field... Let’s say that the user entered the field and did not put anything, when leaving the field (focusout()) you put its value "default"
– Azzi
@Azzi this is the way I do today, but if this library had another way, it would be easier.
– Poliano Martini