Click here to Skip to main content
15,887,886 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi..

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

Plz help

Regards,
Sofia
Posted
Comments
[no name] 15-Aug-12 11:15am    
Any way you want.
Kenneth Haugland 15-Aug-12 11:32am    
Hey, I got edited.. :-)
[no name] 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

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(",")
 
Share this answer
 
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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900