mask SSN with floating field

michaels9529850

15-12-2018

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

Accepted Solutions (1)

Accepted Solutions (1)

michaels9529850

16-12-2018

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);

}

Answers (0)