MaskOfficial Website

Inputmask is a javascript library that creates an input mask. Inputmask can run against vanilla javascript, jQuery, and jqlite.

Javascript
<!-- Inputmask js -->
<script src="{% static 'libs/inputmask/dist/min/jquery.inputmask.bundle.min.js' %}"></script>
Initjs (Custom js)
<!-- Inputmask js -->
<script src="{% static 'js/pages/form-mask.init.js' %}"></script>
Add Package
yarn add inputmask --save
Remove Package
yarn remove inputmask or you can remove package by removing specific package from package.json
Examples:
Title HTML
Date Style 1
<input id="input-date1" class="form-control input-mask" data-inputmask="'alias': 'datetime'" data-inputmask-inputformat="dd/mm/yyyy">
Date Style 2
<input id="input-date2" class="form-control input-mask" data-inputmask="'alias': 'datetime'" data-inputmask-inputformat="mm/dd/yyyy">
Date time
<input id="input-datetime" class="form-control input-mask" data-inputmask="'alias': 'datetime'">
Currency
<input id="input-currency" class="form-control input-mask text-start" data-inputmask="'alias': 'numeric', 'groupSeparator': ',', 'digits': 2, 'digitsOptional': false, 'prefix': '$ ', 'placeholder': '0'">
Repeat
<input id="input-date1" class="form-control input-mask" data-inputmask="'alias': 'datetime'" data-inputmask-inputformat="dd/mm/yyyy">
Mask
<input id="input-mask" class="form-control input-mask" data-inputmask="'mask': '99-9999999'">
IP address
<input id="input-ip" class="form-control input-mask" data-inputmask="'alias': 'ip'">
Email address:
<input id="input-email" class="form-control input-mask" data-inputmask="'alias': 'email'">
© Skote.