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

TextBox loses mask on load

1 Answer 13 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Alina
Top achievements
Rank 1
Alina asked on 19 Aug 2020, 10:01 AM

Here's my JQuery mask for textbox in $(document).ready():

$("#MyTextbox").inputmask({ "mask": "(99:99:9{6,7}:9{1,},{0,1}){1,}", 'autoUnmask': false, clearIncomplete: false });

 

Model contains values as a list so i wrote the element like this:

@(Html.Kendo().TextBox()
   .Value(string.Join(",", Model.Objects.Select(x=>x.SomeValue).ToList()))
   .Name("MyTextbox")
   .HtmlAttributes(...))

 

and instead of 

99:99:9999999:999,66:66:6666666:666,33:33:3333333:333

value shows up like 

99:99:9999999:9996666666666666633333333333333

What can i change to keep the mask for the whole string?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 21 Aug 2020, 07:49 AM

Hi Alina,

Please note, that the mask option is an available configuration for the MaskedTextBox widget. In the MaskedTextBox API, you could find the supported mask rules for the mask:

- https://docs.telerik.com/kendo-ui/api/javascript/ui/maskedtextbox/configuration/mask

In order to have a mask for the entire string, you will need to configure a mask according to the entire string length. You could also use the rules configuration in order to create custom mask rules. The rules can be defined as regular expressions or as a function.

I hope the provided information will be helpful.

Regards,
Neli
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
TextBox
Asked by
Alina
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or