MaskedTextBox is not working for +91xxxxxxxxxx

1 Answer 28818 Views
MaskedTextBox
Kumar Bharat
Top achievements
Rank 1
Kumar Bharat asked on 29 Apr 2014, 09:33 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 29 Apr 2014, 10:14 AM
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.

 
Kumar Bharat
Top achievements
Rank 1
commented on 29 Apr 2014, 10:57 AM

Hi Dimiter,

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

it works

Thanks & Regards,
Kumar
Dimiter Madjarov
Telerik team
commented on 29 Apr 2014, 11:00 AM

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.

 
Tags
MaskedTextBox
Asked by
Kumar Bharat
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or