2

I've setup the following custom rule in a Kendo UI MaskedTextBox:

rules: {
    "~": /[0-9#]/
}

I thought this would allow 0-9 or # in the field, but the mask text of ~ shows up and the masked box won't let me enter anything.

Where am I going wrong with the custom mask? How do I configure a custom mask which will allow entry into the masked text box?

fejese
  • 4,601
  • 4
  • 29
  • 36
Brian Mains
  • 50,520
  • 35
  • 148
  • 257

1 Answers1

1

I was unable to duplicate the asker's problem, but the following code should achieve the requested behavior:

<script>
  $(document).ready(function() {
     $("#with_mask").kendoMaskedTextBox({
       mask: "~~~~~~~~~~",
       rules: {
               "~": /[0-9#]/
              }
      });
   });
</script>

This Fiddle contains a working example.


These Kendo documentation links might be useful for any further problems:

numaroth
  • 1,295
  • 4
  • 25
  • 36