Click here to Skip to main content
12,503,829 members (30,921 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET validation
Hi..

How should i validate textbox with proper email ids that is comma separated

Plz help

Regards,
Sofia
Posted 15-Aug-12 5:10am
sofia3673
Comments
Wes Aday 15-Aug-12 11:15am
   
Any way you want.
Kenneth Haugland 15-Aug-12 11:32am
   
Hey, I got edited.. :-)
Wes Aday 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 15-Aug-12 11:36am
   
No problem :)
Sergey Alexandrovich Kryukov 15-Aug-12 20:06pm
   
Problem is not formulated, not enough information to discuss.
--SA

1 solution

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

Solution 1

Proper E-mail is quite vage term, there are several ways of doing this:
http://forums.asp.net/t/1814131.aspx/1?How+to+verify+email+address+before+sending+a+mail+[^]

for splitting the input simply use String.Split(",")
  Permalink  
v2
Comments
sofia3 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 15-Aug-12 11:51am
   
i dont think you can. How about an address that ends with .com or a one that ends with .co.uk ?
sofia3 15-Aug-12 12:10pm
   
not specific it can be both
sofia3 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)
txtEmail.Focus()
Return False
Else

Return True
End If
sofia3 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 15-Aug-12 12:21pm
   
"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,3})\,$"
sofia3 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160919.1 | Last Updated 15 Aug 2012
Copyright © CodeProject, 1999-2016
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