Nice to Regular expression.
var RE_SSN = /^[0-9]{3}[\- ]?[0-9]{2}[\- ]?[0-9]{4}$/;
JavaScript Tutorial: Regular Expressions
Thanks,
Suresh
Assuming javascript regular expressions don't stray too far from the standard, you can shorten this a lot. Not that it matters a whole lot if this one works, but it's good knowledge to have
^\d{3}-?\d\d-?\d{4}$
\d is equivalent to [0-9]
And if you're matching a single character, you don't need to make it a character class ([-]? is equivalent to -?)