All Components

Validation

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.

@Component({
    selector: 'my-app',
    template: `
        <form #templateForm="ngForm" novalidate>
            <p>Enter valid postcode (A9 9AA)</p>
            <kendo-maskedtextbox
                name="value1"
                [(ngModel)]="value"
                [mask]="mask"
                [maskValidation]="maskValidation"
            ></kendo-maskedtextbox>
            <button [disabled]="!templateForm.valid" type="submit" class="k-button">Submit</button>
        </form>
    `
})

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