Closed ftbraian closed 6 years ago
Igor como poderia colocar o 'clearIfNotMatch = true' no exemplo da mask para telefone com novo digito:
var maskBehavior = function (val) { return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; }, options = {onKeyPress: function(val, e, field, options) { field.mask(maskBehavior.apply({}, arguments), options); } };
$('.phone').mask(maskBehavior, options);
ou teria como colocar o clearIfNotMatch true para todos as mask ?
abs
Olá @ftbraian !
Infelizmente o clearIfNotMatch não é uma opção global e sim de cada input.
Igor como poderia colocar o 'clearIfNotMatch = true' no exemplo da mask para telefone com novo digito:
var maskBehavior = function (val) { return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; }, options = {onKeyPress: function(val, e, field, options) { field.mask(maskBehavior.apply({}, arguments), options); } };
$('.phone').mask(maskBehavior, options);
ou teria como colocar o clearIfNotMatch true para todos as mask ?
abs