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

Exclude characters?

3 Answers 517 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Iron
Veteran
Jason asked on 07 Jan 2021, 06:04 PM
I typically use the mask to prevent the user from entering in "bad" characters. Is this possible with MaskTextBox? I only saw a handful of predefined rules. I know I can use validation too. Perhaps the best method is to notify the user their input is bad AND not allow it to be inputted...

3 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 07 Jan 2021, 06:57 PM

Hello Jason,

At the moment, the only way to do that would be through a data annotation validation - e.g., a regex (you can find a couple of examples here).

Would the ability to define custom rules solve your case? You can see how that would work in our Reach suite that already has this capability here (see the second example). If yes, we could open up a feature request page for you to monitor this on our feedback portal.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Jason
Top achievements
Rank 1
Iron
Veteran
answered on 07 Jan 2021, 07:27 PM
Yes the feature like Reach would be perfect. The MaskedTextBox is great for numbers like date and phone, but apostrophe is very common in names, as well as some extended ascii for accented letters. Annotation/validation is working out fine for us as an alternative.
0
Marin Bratanov
Telerik team
answered on 07 Jan 2021, 07:47 PM

Hi Jason,

I made this page where you can click the Follow button to get email notifications for status updates: https://feedback.telerik.com/blazor/1501432-custom-rules-in-the-masked-textbox. I've added your Vote on your behalf to raise its priority.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
MaskedTextBox
Asked by
Jason
Top achievements
Rank 1
Iron
Veteran
Answers by
Marin Bratanov
Telerik team
Jason
Top achievements
Rank 1
Iron
Veteran
Share this question
or