Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET validation
How should i validate textbox with proper email ids that is comma separated
Plz help
Posted 15-Aug-12 5:10am
Wes Aday at 15-Aug-12 11:15am
Any way you want.
Kenneth Haugland at 15-Aug-12 11:32am
Hey, I got edited.. :-)
Wes Aday at 15-Aug-12 11:34am
Yes... sorry... kind of thought a comma might be more appropriate for a comma seperated split instead of a semicolon....
Kenneth Haugland at 15-Aug-12 11:36am
No problem :)
Sergey Alexandrovich Kryukov at 15-Aug-12 20:06pm
Problem is not formulated, not enough information to discuss.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Proper E-mail is quite vage term, there are several ways of doing this:[^]
for splitting the input simply use String.Split(",")
sofia3 at 15-Aug-12 11:49am
Hey thank you..but i want comma to be displayed automatically in textbox as soon as user enter one of the emailid
Kenneth Haugland at 15-Aug-12 11:51am
i dont think you can. How about an address that ends with .com or a one that ends with ?
sofia3 at 15-Aug-12 12:10pm
not specific it can be both
sofia3 at 15-Aug-12 12:18pm
Dim rex As Match = Regex.Match(Trim(txtEmail.Text), "^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,3})$", RegexOptions.IgnoreCase)
If rex.Success = False Then
'MessageBox.Show("Please Enter a valid Email ID", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
ShowMessageBox("EXCLAMATION", "Data Validation", "Kindly specify a valid EmailID.", False)
Return False

Return True
End If
sofia3 at 15-Aug-12 12:19pm
m using above code it doesnot allow me to enter comma in textbox...i simply want to allow comma how can i do that its urgent plz help
Kenneth Haugland at 15-Aug-12 12:21pm
sofia3 at 16-Aug-12 0:28am
it is not working dear i am not able to enter comma

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Nirav Prabtani 268
1 OriginalGriff 217
2 Mika Wendelius 185
3 Sergey Alexandrovich Kryukov 176
4 CPallini 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Mika Wendelius 185
3 _Amy 170
4 CPallini 170

Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 15 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100