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

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
Level 1
Level 1

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.

2 Replies
radzmar
Level 10
Level 10

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
Level 8
Level 8

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