Edit this page

rules Object

Defines an object of custom mask rules.

Example - specify a custom rule as a RegExp instance

<input id="maskedtextbox" />
<script>
$("#maskedtextbox").kendoMaskedTextBox({
    mask: "~000",
    rules: {
        "~": /[+-]/
    }
});
</script>

Example - specify a custom rule as a function

<input id="maskedtextbox" />
<script>
$("#maskedtextbox").kendoMaskedTextBox({
    mask: "^000^",
    rules: {
        "^": function (char) {
            return char === "^"; //allow ony "^" symbol
        }
    }
});
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy