MaskedTextBox - data-mask attribute not working correctly?

3 posts, 1 answers
  1. Kevin F
    Kevin F avatar
    70 posts
    Member since:
    Sep 2009

    Posted 04 Mar 2016 Link to this post

    Using kendo SPA and I have the following:

    <input type="text" id="txtBillingZip" data-role="maskedtextbox" data-mask="00000" />

    For some reason, the mask doesn't work.  But when I change the mask to this: 

    <input type="text" id="txtBillingZip" data-role="maskedtextbox" data-mask="00000 " />

    The mask works as expected, but of course has the space at the end which I don't want.

    Any thoughts?


  2. Answer
    Dimiter Topalov
    Dimiter Topalov avatar
    1297 posts

    Posted 08 Mar 2016 Link to this post

    Hi Kevin,

    When declarative widget initialization is used, the Kendo UI library parses number-like options as numbers. As a result, the mask attribute is parsed to a single zero digit and cannot be processed correctly in the Kendo UI MaskedTextBox initialization.

    Please check the following help section...

    ... or use script initialization instead of declarative one:

    mask: "00000"

    I hope this helps.

    Dimiter Topalov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kevin F
    Kevin F avatar
    70 posts
    Member since:
    Sep 2009

    Posted 08 Mar 2016 in reply to Dimiter Topalov Link to this post

    Oh jeez.  I swore I read that page 100 times.  Sorry about that, and thank you very much Dimiter!
Back to Top