http://dojo.telerik.com/etIwa/2
<input id="maskedtextbox" />
<script>
var m = "0ba";
// this should limit the first character to 0-9, the second to 0-5, and the third to 0-2
// but enter the following:
// 9
// left arrow
// 2
// left arrow
// 3
// left arrow
// 8
// left arrow
// 9
// leaves us with "983" - only the first character is "valid"
// basically, after you left arrow it will "push" the existing characters to the right (sometimes, not always) when the next character is entered
$("#maskedtextbox").kendoMaskedTextBox({
mask: m,
rules: {
// "0" allows 0-9
"b": function (char) {
return (char === "0" || char === "1" || char === "2" ||
char === "3" || char === "4" || char === "5");
},
"a": function (char) {
return (char === "0" || char === "1" || char === "2");
}
}
});
</script>
<input id="maskedtextbox" />
<script>
var m = "0ba";
// this should limit the first character to 0-9, the second to 0-5, and the third to 0-2
// but enter the following:
// 9
// left arrow
// 2
// left arrow
// 3
// left arrow
// 8
// left arrow
// 9
// leaves us with "983" - only the first character is "valid"
// basically, after you left arrow it will "push" the existing characters to the right (sometimes, not always) when the next character is entered
$("#maskedtextbox").kendoMaskedTextBox({
mask: m,
rules: {
// "0" allows 0-9
"b": function (char) {
return (char === "0" || char === "1" || char === "2" ||
char === "3" || char === "4" || char === "5");
},
"a": function (char) {
return (char === "0" || char === "1" || char === "2");
}
}
});
</script>