Hello, I have the following function
function CarregarMascaras() {
$('[data-mascara=numeroMonetario]').keyup(function () {
this.value = this.value.replace(/[^0-9]+[^\,]?[^0-9]+/g, '');
}).on('paste', function () {
this.value = this.value.replace(/[^0-9]+[^\,]?[^0-9]+/g, '');
});
}
The idea of it is as you type, it checks what you have there and maintains it in a format type: N , N . Since N is a quantity of any numbers, but when testing it, it is accepting numbers like N , N , N or N < N . N . I would like this function to accept only numbers of type: N , N .