Jump to content

Input Mask Ssn Social Security Number

Recommended Posts

Try this


function f_a(v_id)
return document.getElementById(v_id);

f_a('FIELDID').maxLength = 11;

f_a('FIELDID').onkeyup = function(v_e)
v_e = v_e || window.event;

if (v_e.keyCode >= 65 && v_e.keyCode <= 90){
	this.value = this.value.substr(0, this.value.length - 1);   
	return false;
}else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){
	return true;

var v_value =(this.value.replace(/[^\d]/g, ''));   

this.value = ( v_value.substring(0,3) + "-" + v_value.substring(3,5) + "-" + v_value.substring(5,9)); 


Replace FIELDID with SSN Field ID

Link to comment
Share on other sites

  • 5 years later...


I also have a short script that will mask SSN value in a Details Page.


var account = document.getElementById('EditRecordSSN');

account.value = new Array(account.value.length-3).join('x') + 
account.value.substr(account.value.length-4, 4);


Replace SSN in EditRecordSSN depending on the correct field name in the Table. 



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...