Skip to content

Imask Field (PRO)

Imask Field is a text field that allows various masking options to ensure convenient data input in the required format. Masking is configured using the iMask.js library.

Imask Field

Example configurations:

  1. Phone Number
javascript
{
    mask: '+{38} (000) 000-00-00'
}
  1. Date
javascript
{
    mask: Date,
    pattern: 'd{.}`m{.}`Y',
    blocks: {
        d: { mask: IMask.MaskedRange, from: 1, to: 31 },
        m: { mask: IMask.MaskedRange, from: 1, to: 12 },
        Y: { mask: IMask.MaskedRange, from: 1900, to: 2099 }
    }
}
  1. Currency Amount
javascript
{
    mask: Number,
    thousandsSeparator: ' ',
    radix: ',',
    scale: 2
}
  1. Credit Card Number
javascript
{
    mask: '0000 0000 0000 0000'
}

For more examples, visit the iMask.js website.

© PageBlocks 2019-present