Click here to Skip to main content
14,970,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone help me?
How can I check mail id in my textbox whether it is correct or not?
Posted
Updated 14-Nov-10 21:04pm
v2

Please try the below expression for checking with Javascript.

^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$

If you are using ASP.Net you can use the Regular expression validator

XML
<asp:RegularExpressionValidator ID="valEmailAddress" runat="server" ControlToValidate="txtEmailAddress" CssClass="validator"      ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="Next" Width="168px"
 Display="Dynamic">Incorrect e-mail address</asp:RegularExpressionValidator>
   
v2
Comments
TweakBird 15-Nov-10 14:19pm
   
Good call

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