This is a migrated thread and some comments may be shown as answers.

Mask rules can be violated with left arrow

1 Answer 33 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 11 Mar 2015, 10:15 PM
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>

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Mar 2015, 07:24 AM
Hello Terry,

Thank you for drawing our attention to this issue. Currently, widget just pushes the rest of the input to the right, instead of validating the newly created value. I logged this erroneous behavior for further investigation and fix.

As a gratitude for your involvement I updated your Telerik points.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MaskedTextBox
Asked by
Terry
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or