New to Kendo UI for AngularStart a free 30-day trial

Definition

Package:@progress/kendo-angular-inputs

Selector:kendo-maskedtextbox

Export Name:Accessible in templates as #kendoMaskedTextBoxInstance="kendoMaskedTextBox"

Syntax:

TS
import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
    <kendo-maskedtextbox
      [mask]="mask"
      [value]="value">
    </kendo-maskedtextbox>
  `
})
export class AppComponent {
  public value: string = "9580128055807792";
  public mask: string = "0000-0000-0000-0000";
}

Inputs

disabled

boolean

Disables the MaskedTextBox when you set it to true (see example). To disable the component in reactive forms, see Forms Support.

Default:

false

Sets the background and border style of the MaskedTextBox (see example). The default value is set by the Kendo theme.

When true includes literals in the raw value (see example).

Default:

false

inputAttributes

{ [key: string]: string }

Sets HTML attributes for the inner input element. You cannot change attributes that are essential for component functionality.

mask

string

Sets the mask pattern for the MaskedTextBox (see example). If you do not set a mask, the component acts as a standard type="text" input.

If the mask allows spaces, set the promptPlaceholder to a character that the mask does not accept.

Shows the mask on focus when the value is empty.

Default:

false

Enables the built-in mask validator when you set it to true (see example).

Default:

true

prompt

string

Sets the prompt character for the masked value.

Default:

'_'

Sets the character that represents an empty position in the raw value.

Default:

' '

readonly

boolean

When true, sets the MaskedTextBox to read-only mode (see example).

Default:

false

Sets the border radius of the MaskedTextBox (see example). The default value is set by the Kendo theme.

rules

{ [key: string]: RegExp }

Sets the RegExp-based mask validation rules (see example).

Sets the padding size of the MaskedTextBox input element (see example). The default value is set by the Kendo theme.

tabindex

number

Sets the tabindex attribute of the component.

Default:

0

title

string

Sets the title attribute of the input element.

value

string

Sets the value of the MaskedTextBox.

Fields

Returns the ElementRef of the visible input element.

Events

Fires when the MaskedTextBox gets blurred.

To subscribe programmatically, use the onBlur property.

Fires when the MaskedTextBox gets focused.

To subscribe programmatically, use the onFocus property.

Fires when the input element gets blurred.

Fires when the input element gets focused.

Fires when the value changes.

Methods

Blurs the MaskedTextBox.

Focuses the MaskedTextBox.