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

Email validation fails using rad masked edit box

1 Answer 22 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Toby
Top achievements
Rank 1
Toby asked on 01 Nov 2018, 10:12 AM

Hi

I have an issue with the validation of email addresses using when the mask type is set to EMail, it is not allowing the following style of email address "t.harris@working.group" (note this is not the exact email address of obvious reasons), it does work when i append .co.uk or .com on the end.

What are the validation criteria for this EMail validation ? 

Do I have to use an edit mask instead ? If so can you give an example which will allow above email address as well as those in more "normal" formats ?

 

Regards

Toby

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Nov 2018, 10:57 AM
Hi Toby,

We are using a regex mask for the email. In order to validate such email address, you will need to modify the mask a little. Here is an example:
radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Regex;
 
radMaskedEditBox1.Mask = @"^([a-zA-Z0-9_\-\.']+)@((\[[0-9]{1,3}" +
 @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
 @".)+))([a-zA-Z]{2,5}|[0-9]{1,4})(\]?)$";

Notice the number five in the regex expression which was previously four and this is the only change I have made.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MaskedEditBox
Asked by
Toby
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or