MaskEdit Properties

HidePromptOnLeave

The MaskEdit provides the option to hide the prompt when you focus out from the control. The mask prompt is visible when you focus again to the control. The default value of hidePromptOnLeave is false.

InputMode

The MaskEdit supports two type of inputs such as text and password that have been assigned by using the enum values ej.InputMode.Text and ej.InputMode.Password. The default value for inputMode is text in MaskEdit.

MaskFormat

The MaskEdit provides the option to define the maskFormat to the value. The default value for maskFormat property is empty string.

The following steps explain the implementation of MaskEdit Properties.

In the HTML page, add a <div> element to render the MaskEdit widget.

  • html
  • <input id="maskEdit" type="text" />
  • javascript
  • /// <reference path="jquery.d.ts" />  
    /// <reference path="ej.web.all.d.ts" />
    
    module EditorComponent {
        var mask = new ej.MaskEdit($("#maskEdit"), {
                name: "mask",
                inputMode: ej.InputMode.Text,
                maskFormat: "99-999-CCCC",
                customCharacter: "r",
                hidePromptOnLeave: true
            })
    }

    The output for MaskEdit with its properties is as follows.

    MaskEdit with MaskFormat

    MaskEdit with HidePromptOnLeave

    MaskEdit with prompt focus

    MaskEdit with InputMode text

    MaskEdit with CustomCharacter