Thursday, April 3, 2008

Validating E-Mail Address Using JavaScript Regular Expression:


In this Post I will tell you how to Validate E-Mail address format using javascript regular expression


function ValidateEmail()
{
var EmaiAddress=document.getElementById("txtemail").value;
var RegExEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
if (!RegExEmail.test(EmaiAddress))
{
alert("Please Enter Valid E-mail Adress");
}
else
{
alert("Go Ahead!");
}
}


All i have done in above code is Call ValidateEmail function on click of a Button named Checkit! and check value in text element. to call function write onclick="ValidateEmail()" in attribute of button element

5 comments:

parisa jalili said...on Validating E-Mail Address Using JavaScript Regular Expression:

Hello
I have a question regarding c#.net programming. Is it there any way to develp an application which accesses an sql server database and run it from the cd?
I will be thankful to recive your answer regarding the solution.
Thanks.,

Vijay said...on Validating E-Mail Address Using JavaScript Regular Expression:

can any one said how to display blog archieve using asp.net with C#...

Anonymous said...on Validating E-Mail Address Using JavaScript Regular Expression:
This post has been removed by a blog administrator.
ankush said...on Validating E-Mail Address Using JavaScript Regular Expression:

hi

Anonymous said...on Validating E-Mail Address Using JavaScript Regular Expression:

Worked great, thank you for posting this function. Regards.

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Nirav Bhatt