Add this attribute to your input element to make it display as a social security number.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore code, readme, and test Dec 10, 2015
LICENSE.md code, readme, and test Dec 10, 2015
README.md code, readme, and test Dec 10, 2015
bower.json bower.json fixes Dec 10, 2015
input-ssn.js code, readme, and test Dec 10, 2015
test.js code, readme, and test Dec 10, 2015

README.md

angular-input-ssn

Add this attribute to your input element to make it display as a social security number.

It's a simple angularjs directive that changes the way an input looks without changing the value that angular sees for it. It restricts the user to type only numeric characters and adds hyphens to the number.

Because it's such a small amount of code, it should be able to read and understand so you can even tweak it for your needs. In fact, I encourage it!

Available on Bower

bower install angular-input-ssn

How To

Simply include the input-ssn module

var app = angular.module('app', [ 'input-ssn' ]);

Then use the usd attribute on input fields in your html

<input type="text" ssn ng-model="ssn" />

Note that the input type must be text in order for angular to allow it to watch where your cursor is and not reset where your typing after each character. ng-model is required.

That's it!

Check out the github pages example here: http://deltreey.github.io/angular-input-ssn/