Forms

Input Mask

A javascript input mask library that helps the user with the input by ensuring a predefined format.

Requirements

<script src="js/vendor/imask.js"></script>

Example

Javascript
IMask(document.querySelector('#dateMask'), {
  mask: Date,
  min: new Date(1900, 0, 1),
  max: new Date(2020, 0, 1),
  lazy: false,
});
Html
<div>
  <label class="form-label">Date</label>
  <input type="text" class="form-control" id="dateMask" />
</div>

More Examples

You may find more examples in Interface.Forms.InputMask.html file which is initialized by js/forms/inputmask.js.

Documentation