jQuery-Mask-Plugin icon indicating copy to clipboard operation
jQuery-Mask-Plugin copied to clipboard

Mask DDD

Open airtonct opened this issue 6 years ago • 0 comments

utils.prototype.maskDdd = (function (object) { object.forEach(function (name) { var behavior = function (val) { return val.replace(/\D/g, '').length === 3 ? '(000)' : '(009)'; }, options = { onKeyPress: function (val, e, field, options) { field.mask(behavior.apply({}, arguments), options); }, clearIfNotMatch: true }; $(name).mask(behavior, options); }); });

how to make the dynamic mask of 2 and 3 numbers with caracters at the beginning and end of the mask?

thanks you

airtonct avatar Feb 28 '19 17:02 airtonct