0.0.3 • Published 9 years ago

format-input v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Format Input

Format user input as a date/credit card/etc.

npm install format-input --save

example

var formatInput = require('format-input');

formatInput(document.getElementById('#date-of-birth'), 'cc/cc/cccc');

Now enter the date 19/05/1985

When you type 190 it will be reformatted to 19/0

as you continue it will be reformatted until it reaches the end of the given format.

You can also supply a different separator, in fact you can use any character except for the placeholder which defaults to c if this conflicts with your format (or you just don't like the letter 'c' then you can change the placeholder to something else, like !. formatInput(element, '!!:!!, '!')

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago