Open surjit opened 8 years ago
@surjit ,
This is not possible out of the box. You can tweak the postValidation in the numeric alias to allow it. I can include it in a future release.
please give me example, how to use it or docs
Inputmask.extendAliases({
"mynumeric": {
alias: "numeric",
postValidation: function(buffer, currentResult, opts) {
var isValid = true,
maskedValue = opts.numericInput ? buffer.slice().reverse().join("") : buffer.join(""),
processValue = maskedValue.replace(opts.prefix, "");
processValue = processValue.replace(opts.suffix, "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.radixPoint === ",") processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".");
//handle negation symbol
processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
processValue = processValue === opts.negationSymbol.front ? processValue + "0" : processValue;
if (isFinite(processValue)) {
// ADD CODE TO CHECK THE MIN MAX FOR DIGITS
}
return isValid;
}
});
is it possible to mask only digits in certain range {min:1,max:100}