Skip to main content
ezloves2smile
Known Participant
December 13, 2021
Answered

Masking SSN field for email and then unmasking to recipient?

  • December 13, 2021
  • 2 replies
  • 4340 views

Hello, this may not be possible and if it is... I hope my question makes sense. Please be patient with me as I am still a beginner when it relates to custom script on Adobe DC. I am looking to put a field (let's say it is a field for a social security number). When the user inputs the social security number, it will mask it (to only show the last 4 numbers once entered). When the form is emailed the ssn will show masked. When the recipient receives the email, the recipient can access the full social security number (if they needed to access it). That's all Im trying to do and I hope this makes sense? Thank you in advance for your time and help!

 

NOTE - there is no such program as Adobe DC, moving to Acrobat

You need to ask program questions in the forum for the program you are using
To ask in the forum for your program please start at https://community.adobe.com/
Moving from Using the Community (which is about the forums) to the correct forum... Mod

This topic has been closed for replies.
Correct answer try67

Hello and my apologies for the delay. You'd enter the # (123-45-6789) and it would automatically show (XXX-XX-6789) to the individual entering the information. Let's call the text field "SSN" and then another hidden field (accessible only by the recipient receiving the data) would get the full number. Let's call that field "SSN Reveal". I hope this makes sense? Oh and any forms would be sent through a secure server / message. I was able to confirm that. Thank you for your valuable time!


You can use this code as the custom validation script of the "SSN" field:

 

this.getField("SSN Reveal").value = "";
if (event.value) {
	if (/^\d{3}-\d{2}-\d{4}$/.test(event.value)) {
		this.getField("SSN Reveal").value = event.value;
		var ssnParts = event.value.split("-");
		event.value = "XXX-XX-"+ssnParts[2];
	} else {
		app.alert("Invalid value.");
		event.rc = false;		
	}
}

2 replies

Legend
December 14, 2021

If it's an SSN it shouldn't be in an email - even if cosmetically masked. You may have unlimited legal liabilities. You need to use a secure web server (https submit) with script written by a specialist.

try67
Community Expert
Community Expert
December 13, 2021

"Masking" a value in a PDF is purely cosmetic. If you don't want sensitive information to be extracted from the file either don't enter it in the first place, or don't use a PDF file for this purpose, but a more secure way of transferring data.

ezloves2smile
Known Participant
December 14, 2021

Is there a way to do it even for cosmetic purposes? Thank you for the prompt reply!