EMail Validation using JQuery with Regular Expression | How to do EMail validation using JQuery

We can do email validation using JQuery. Please check below code. Here i have using regular Expression for doing email validation.

For more validations, please go through this Form Validations


EMail VAlidation using JQuery in ASP.NET
EMail VAlidation using JQuery with RegularExpression 

<html xmlns="">
    <script src=""></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#btnSubmit').click(function() {
                var inputEmail = $("#txtEmail").val();
                var emailRegularExpression = /^(^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*)@[0-9a-zA-Z]+([_.-]?[0-9a-zA-Z])*\.[a-zA-Z]{2,4})+$/;

                if (!emailRegularExpression.test(inputEmail)) {
                    $('#ErrorMessage').html('Invalid Email Address');

    <input type="text" id="txtEmail" />
    <input type="submit" id="btnSubmit" />
<div id='ErrorMessage' style="color:red;"></div>

Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar