Jump to content

Input Mask Ssn Social Security Number


Recommended Posts

Try this

<SCRIPT LANGUAGE="JavaScript">

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

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

</script>

Replace FIELDID with SSN Field ID

Link to comment
Share on other sites

  • 5 years later...

Hello, 

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

<script>

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

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

</script>

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

 

Cheers!

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.

Guest
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.

Loading...
 Share

×
×
  • Create New...