Skip to main content
yanksgirl
Inspiring
September 25, 2019
Question

Mask first 5 of social security number

  • September 25, 2019
  • 1 reply
  • 1991 views

I have a form that brings information from my core system and plugs into the mapped fields.  One of the fields is applicant social security number.  This field comes over from the core as the 9 digit social security number, which then populates on the form.  The core company does not offer a masked version of this field. 

 

How can I set the text field to mask the first 5 of the social security with X's(or whatever at this point).  I'm self taught so I'm not versed in any scripting that would make this possible.  I attemtped to use an Arbitrary Mask format but that didn't work.  Any help would be appreciated!

 

 

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 25, 2019

    I would use the Custom Format script option for the text field. This will mask the displayed value but still allow input and editing of the full SSN. You could also create a keystroke script to accept the 9 digit or the edited SSN. You may needformat to set the format to None. A possible sctipt could be:

    if(/^(\d{3}[-. ](\d{2}[-. ](\d{4}$/).test(event.value) == true){
    event.value = "***-**-" + RegExp.$3;
    }

     

     

     

     

    yanksgirl
    yanksgirlAuthor
    Inspiring
    October 2, 2019
    Thank you! I ended up doing a combo of multiple things I found (using some of your logic as well) and it works like a charm!
    Participant
    March 7, 2024

    Do you mind sharing your solution?  I have the exact situation that I'm working to solve for.