Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

mask SSN with floating field

michaels9529850
Level 1
Level 1

On my form, I want to give the user the option to mask SSN. If checkbox = true, then only display last 4 digits of the SSN.  Then in the document, it will display value via a floating field.  I cannot figure out how to concatenate the mask and only display the last 4 digits of the SSN string.  The Display pattern for ParticipantSSN text box and floating field is text{999-99-9999}

In the checkbox mouseup event, I have this javascript:

var PSSN = ParticipantSSN.rawValue; // Length is 9

var mask = "XXX-XX-";

if(chkPredact.rawValue == false) {

fltParticipantSSN.rawValue = PSSN;

}else{

fltParticipantSSN.rawValue = concat(mask + slice(PSSN,6,4));

}

Thank you in advance

Mike

1 Accepted Solution
michaels9529850
Correct answer by
Level 1
Level 1

var PSSN = ParticipantSSN.rawValue; // Length is 9

var mask = "XXX-XX-";

if(chkPredact.rawValue == false) {

fltParticipantSSN.rawValue = PSSN;

}else{

fltParticipantSSN.rawValue = mask + PSSN.substring(5,9);

}

View solution in original post

1 Reply
michaels9529850
Correct answer by
Level 1
Level 1

var PSSN = ParticipantSSN.rawValue; // Length is 9

var mask = "XXX-XX-";

if(chkPredact.rawValue == false) {

fltParticipantSSN.rawValue = PSSN;

}else{

fltParticipantSSN.rawValue = mask + PSSN.substring(5,9);

}

View solution in original post