This is a migrated thread and some comments may be shown as answers.

FIXED 0's inside mask

3 Answers 97 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Gilberto
Top achievements
Rank 1
Gilberto asked on 16 Sep 2014, 03:54 AM
I'd like to have a kind of mask '___.___.___/0001-__', there is some escape caracter to consider 0 as fixed and not numeric.

Thanks

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Sep 2014, 11:29 AM
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!
 
0
Gilberto
Top achievements
Rank 1
answered on 16 Sep 2014, 12:15 PM
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




0
Accepted
Georgi Krustev
Telerik team
answered on 17 Sep 2014, 08:18 AM
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!
 
Tags
MaskedTextBox
Asked by
Gilberto
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Gilberto
Top achievements
Rank 1
Share this question
or