MaskedTextBox is not working for +91xxxxxxxxxx

4 posts, 1 answers
  1. Kumar Bharat
    Kumar Bharat avatar
    9 posts
    Member since:
    Feb 2013

    Posted 29 Apr 2014 Link to this post

    Hi,

    I want to mask Indian cell phone number like +91xxxxxxxxxx .
    It is showing +_1__________ instead of +91__________

    Please suggest how to do?

    Find the attached image for my code and output of screen.

    Thanks & Regards,
    Bharat
  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 29 Apr 2014 Link to this post

    Hello Kumar,


    The reason for the current behavior is that the 9 is part of the predefined mask rules and it stands for a digit or space. Nevertheless each of these rules could be escaped with a backslash.
    E.g.
    @(Html.Kendo().MaskedTextBox()
         .Name("phone_number")
         .Mask("+\\910000000")

    I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Kumar Bharat
    Kumar Bharat avatar
    9 posts
    Member since:
    Feb 2013

    Posted 29 Apr 2014 in reply to Dimiter Madjarov Link to this post

    Hi Dimiter,

    Thanks for your reply.
    @Html.Kendo().MaskedTextBoxFor(m => m.Cell).Mask("+\\910000000000")

    it works

    Thanks & Regards,
    Kumar
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 29 Apr 2014 Link to this post

    Hi Kumar,


    I am glad that the issue is resolved. Do not hesitate to contact us again if you experience further problems.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready