Write 0 as a masked textbox mask

I am using a kendo masked textbox widget to mask the input. The input must be of the form HR-D001-XXXX, where "001" must be "001" and the user must not write or edit this part of the field. "XXXX" should be four digits (easy).

So my question is, is there a way to teach Kendo to treat 0 as rule 0 in the regex rule for maskedTextBox and some other value (for example d) how it was used to treat 0? So I could write an expression like HR-D001-dddd?

thank

+3


source to share


1 answer


How about defining it mask

as `HR-D \ 0 \ 01-0000``



$(document).ready(function() {
  $("#example").kendoMaskedTextBox({
    mask: "HR-D\\0\\01-0000"
  });
});
      

<link href="http://cdn.kendostatic.com/2014.2.1008/styles/kendo.common.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2014.2.1008/styles/kendo.default.min.css" rel="stylesheet" />
<script src="http://cdn.kendostatic.com/2014.2.1008/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.2.1008/js/kendo.all.min.js"></script>

<input id="example"/>
      

Run codeHide result


+2


source







All Articles