In Livecycle, How do I hide the first five numbers in a SSN and make the last 4 visible using JS, jquery, or just Livecyle?

lanceb46396443

05-10-2015

There has to be a way in LiveCycle to enter a SSN and it automatically hides the numbers entered and keeps the final four visible. LiveCycle may have a solution but I may have to use JS or jQuery.

Accepted Solutions (0)

Answers (2)

Answers (2)

radzmar

MVP

06-10-2015

In Designer you can use either the scripting language FormCalc or JavaScript but not jQuery.

Can you please provide a better description of what you're after?

How do the SSN look like you will enter and how the< should look finally?

dcidev

07-10-2015

Try this:

1) Create a hidden field ("hiddenField") to store the SSN value

2) In your SSN input field under the enter event (JavaScript) put:


this.rawValue=hiddenField.rawValue;


3) In the same field under the exit event put:


hiddenField.rawValue=this.rawValue;


this.rawValue="*";


for (var i=0;i<hiddenField.rawValue.length;i++){


  if (hiddenField.rawValue.length>i+4)


  this.rawValue+="*";


  else


  this.rawValue+=hiddenField.rawValue.substr(i,1);


}


Kyle