AutoMask
Auto mask your inputs without setting JavaScript
Instable version
This version is below version 1.0.0 and some unexpected behaviors may occur.
Install
npm i automask
or just import the javascript into /dist/web/ into your web project.
Import
Module
Just import with require and use:
require'automask'
Web
Download script into /dist/web/ folder and import normally:
Usage
All settings are usable on HTML and works on IE11+ browsers.
<!-- MAC Address --> <!-- show the empty mask --> <!-- Percentage --> <!-- Money -->
Settings
All AutoMask settings are enabled with HTML. Just set the attribute and use.
mask
to define your pattern;prefix
to set an prefix;suffix
to set an suffix;show-mask
to set whether or not to display the mask;accept
Regular Expression for accepted characters (default is only numbers);persist
Regular Expression to set what characters submit on form.- [BETA]
dir
to set fill direction;
Mask
The mask accepts all characters and have only two special characters, the _
and 0
.
These characters are where your value will stay, and the 0
will works like an zero pad (for example, to pad the money or percentage).
Dir
The dir
set the completion direction. Accept two values, backward
and forward
. The default value is forward
.
Author
- Created and maintained by Emerson C. Romaneli (@ECRomaneli).