Aspx page
<asp:TextBox ID="txtEmail" runat="server" onClientClick="validateEmail()"/>
<script>
Function validateEmail()
{
var reg=/^([A-ZaZo-9_\-\+\@([A-Za-Zo-9_\-\.])+\.([A-Za-Z]{2,4})$1;
var mail=document.getElementById("txtEmai").value;
if(reg.test(mail)==false)
{
alert('Invalid Email Address');
return false;
}
return true
}
</script>
The above code is used to validate email Format
Thanks
Sreejesh
Email Validation for Text Box
Validate text box ,if enter string is email charecter or not
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Sreejesh SPPosted May 26, 2013, 11:45 PM
Thanks%20agarwal
Sreejesh SPPosted May 26, 2013, 11:45 PM
Dear%20sandeep%2C%20Your%20question%20is%20correct%20but%20this%20validation%20is%20only%20email%20format%20cheching%2Cmy%20next%20blog%20is%20implement%20your%20answer
Meet AgarwalPosted May 25, 2013, 10:22 AM
Nice
Sandeep Singh ShekhawatPosted May 25, 2013, 10:10 AM
It%20checks%20email%20syntax%20something%20like%[email protected]%2C%20how%20can%20check%20its%20valid%20email%20or%20not%3F
Sreejesh SPPosted May 25, 2013, 4:37 AM
Dear rohit, please enter a string in to a Textbox, then press tab key then Fire this script, and this script fire as to any client side such as button click or others
Rohit KapdiPosted May 25, 2013, 4:29 AM
This script can also run on event such like onblur() event of textbox also or only on onclientclick() event.