The MaskedTextBox features a built-in mask validator which ensures that the user submits a valid input.

By default, the validator is enabled. To turn it off, set the maskValidation property to false.

    selector: 'my-app',
    template: `
        <form #templateForm="ngForm" novalidate>
            <p>Enter valid postcode (A9 9AA)</p>
            <button [disabled]="!templateForm.valid" type="submit" class="k-button">Submit</button>

class AppComponent {
    public value: string = "M1 1AE";
    public mask: string = "A9 9AA";
    public maskValidation: boolean = true;

In this article