FIXED 0's inside mask

4 posts, 1 answers
  1. Gilberto
    Gilberto avatar
    7 posts
    Member since:
    May 2009

    Posted 15 Sep 2014 Link to this post

    I'd like to have a kind of mask '___.___.___/0001-__', there is some escape caracter to consider 0 as fixed and not numeric.

    Thanks
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 16 Sep 2014 Link to this post

    Hello Gilberto,

    Any predefined rule can be escaped using "\" (backslash) symbol. Check the MaskedTextBox documentation for more information.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Gilberto
    Gilberto avatar
    7 posts
    Member since:
    May 2009

    Posted 16 Sep 2014 in reply to Georgi Krustev Link to this post

    Thanks for reply.

    But i tried before this mask: i used '\' before '.' and before '1'
    '999\.999\.999/\0\0\01-99'
    And this is the result:
    ___,___,___/______

    BTW i am changing in runtime:

    $("#DOCUMENTO").data('kendoMaskedTextBox').setOptions({ mask: '999\.999\.999/\0\0\01-99' });

    Thanks




  5. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 17 Sep 2014 Link to this post

    Hi,

    In the context of the JavaScript string, you will need to escape the "\" symbol too (note this is not related to Kendo UI by any means). The correct mask rule should look like this:
    mask: "999\\.999\\.999/\\0\\0\\01-99",
    A demo that demonstrates this can be found here.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready