Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Basic Social Security Number Validation</title>
</head>
<body>
  <pre>Basic Validation (Format Only)</pre>
  <input id='ssn1' value='555-55-5555' /><button onclick='basicValidate(ssn1.value);'>Validate</button>
</body>
</html>
 
//Basic Validation (format only)
function basicValidate(ssn){
      //Build your expression
      var regex = new RegExp("^\\d{3}-\\d{2}-\\d{4}$");
      //Test your current value
      alert(regex.test(ssn));
}
  
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rionmonsterpro
0viewers