Partial Password Masking on Input Field

前端 未结 3 674
独厮守ぢ
独厮守ぢ 2020-12-17 21:17

So I need to mask a SSN# input field, lets say the ssn is 123-45-6789, I need to display ***-**-6789 (real time as they enter each digit) but I sti

3条回答
  •  感动是毒
    2020-12-17 22:01

    This might be a little sloppy, but it works as you want it to, is all in one text field, returns the full accurate SSN (despite replacing first 5 values with bullet points), and allows for editing anywhere in the field.

    
    
    

    Essentially, every time the input is changed, it checks to see if it matches the first 5 from before, and if it doesn't, it will update the necessary characters.

提交回复
热议问题