So, I need to mask the input field SSN #, say ssn 123-45-6789 , I need to display ***-**-6789 (in real time when entering each digit), but I still need to keep the original value for sending ,
I got to the point that I can do this if the user strictly enters a value, but it breaks if the user does something else, for example, deleting or moving the cursor to a random position and adding / removing numbers, copying the insert / delete, etc. d. I really don't want to listen to a bunch of events to make this work, even if it's possible.
I also tried to have the div sit on top of the input field to display the masked ssn, while the actual ssn was transparent / hidden behind it, but again they lose functionality, allowing you to add / remove / select delete / insert random parts (others then, when they start at the end), and also the cursor is not fully synchronized with the end of the ssn number (the problem with the asterisk was the problem). It also violated some mobile browsers.
I also thought about having two separate input fields, one type of password and one type of text, located next to each other, but again highlighting and deleting / pasting between them would be a problem.
Ideally, if there is something there to have an input field, there are two types, part of the value is the password type, and the rest is text of the type that would be fantastic. Btw this is for js app response.
TL; DR: requires a fully functional input field that will mask the password only from the first 5 digits of ssn and be plain text for the last 4 digits (if there is a full value of the plaintext to send).
Thanks!