imaskjs
imaskjs copied to clipboard
Redaction support in mask
Hi,
I have a field that captures SSN. Currently I use mask 000-00-0000 to capture it. There is a need to hide the first five characters as the user types in. The mask for same would look like XXX-XX-0000, where X maps to 0 (pattern), but does not show the typed digit. e.g. masked value = XXX-XX-3434 unmasked value = 123453434
Is there a way to achieve this?
Thanks, Anil
Hi! Sorry for delay.
Currently there is no such thing. But you are not the first who asked about it, so i consider adding it in next release. If you need it right now, then can take a look at MaskedPattern class and its definitions to override charater for masked.
If you need it right now, then can take a look at MaskedPattern
I extended the class MaskedRegExp class and added some behavior. Added example Is this what you recommend? Thanks
Hm... looks closely, but not complete: only lazy
mode is working and input inside XX breaks everything. Going this way i suppose you have to copy-paste almost all stuff in input-definition.js
to get it work correctly. But i don't see better way without changing PatternInputDefinition
interface in lib itself.