Input the Social Security Number using either the 9 digit or NNN-NN-NNNN format. The number ranges can be easily changed by the S.S.A, so this is not checked.
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin function
SSNValidation(ssn){ var
matchArr =
ssn.match(/^(\d{3})-?\d{2}-?\d{4}$/); var
numDashes =
ssn.split('-').length-1; if(matchArr
==null||
numDashes ==1){ alert('Invalid
SSN. Must be 9 digits or in the form NNN-NN-NNNN.'); msg ="does not appear to be valid";
} else
if(parseInt(matchArr[1],10)==0){ alert("Invalid
SSN: SSN's can't start with 000."); msg ="does not appear to be valid";
} else{ msg ="appears to be valid"; alert(ssn
+"\r\n\r\n"+
msg +" Social Security Number."); }
} // End --> </script> <form> <tt> SS #:
<input
type=textname=ssnsize=11maxlength=11>
(use dashes!) </tt>
<br><br> <inputtype=buttonvalue="Validate
Number"onClick="SSNValidation(this.form.ssn.value);">
</form>