Hi,
I'm Thai-working in US. I'm using Visual Studio 2008 and very new in this. After the user keys in Social Sec No. , I will validate the format and reformat and then display it back using JavaScript. I got it done except I can not display the new string back. Sample input 123456789 -> output 123-45-6789.
//JavaScript
function CheckSS(sender, args) {
var SSNum = parseInt(args.Value);
SSNum = String(SSNum);
var SSlength = parseInt(args.Value).toString().length;
args.IsValid = true;
if ((SSlength > 9) || (SSlength < 9)){
args.IsValid = false;
}
else
{
//format SS# to 999-99-9999
var strSS = SSNum.substring(0, 3) + "-" + SSNum.substring(3, 5) + "-" + SSNUM.substring(5, 9);
document.getElementById('txtSocscnum').innerHTML = strSS;
// I even tried
var SSRet2 = document.getElementById(args);
SSRet2.innerHTML = strSS;
}
}