Today, We want to share with you jQuery Validate Email address using Regex Expression.In this post we will show you email validation in jquery php, hear for email and confirm email validation in jquery we will give you demo and example for implement.In this post, we will learn about jquery regex replace,javascript regular expression match with an example.
jQuery Validate Email address using Regex Expression
There are the Following The simple About jQuery Validate Email address using Regex Expression Full Information With Example and source code.
As I will cover this Post with live Working example to develop Email address validation in jQuery using Regular Expressions, so the some major files and Directory structures for this example is following below.
- index.php
jQuery Validate Email address using Regex Expression Example
index.php
This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.php.
<?php /* Developer: Jaydeep Gondaliya Site: pakainfo.com Script: jQuery Email Validation using Regex Expression File: index.php */ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="jQuery simple Validate Email address using Regex Expression by pakainfo.com"> <meta name="author" content="BootstrapBay.com"> <title>jQuery simple Validate Email address using Regex Expression by pakainfo.com</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <div class="container"> <div style="background: #CE6F9E;"> <div class="row"> <div class="col-md-6 col-md-offset-3"> <h1 class="page-header text-center">jQuery Validate Email address using Regex Expression</h1> <form class="form-horizontal" role="form" method="post"> <div class="memfield form-group"> <label for="name" class="col-sm-2 control-label">Member Name</label> <div class="col-sm-10"> <input type="text" class="mem form-control gst" id="memberFname" name="member_name" placeholder="Member Name" value=""> </div> </div> <div class="memfield form-group"> <label for="name" class="col-sm-2 control-label">Member Last Name</label> <div class="col-sm-10"> <input type="text" class="mem form-control gst" id="last_name" name="member_name" placeholder="Member Last Name" value=""> </div> </div> <div class="memfield form-group"> <label for="email" class="col-sm-2 control-label">Email</label> <div class="col-sm-10"> <input type="email" class="mem form-control gst" id="live_sender_email" name="live_sender_email" placeholder="[email protected]" value=""> </div> </div> <div class="memfield form-group"> <div class="col-sm-10 col-sm-offset-2"> <input id="my_btn_sender" name="my_btn_sender" type="button" value="Send" class="btn btn-primary"> </div> </div> <div class="memfield form-group"> <div class="col-sm-10 col-sm-offset-2"> <p id="message"></p> </div> </div> </form> </div> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.2.4.js" crossorigin="anonymous"> </script> <script type="text/javascript"> $(document).ready(function(e) { $('#my_btn_sender').click(function() { var live_sender_email = $('#live_sender_email').val(); if ($.trim(live_sender_email).length == 0 || $("#memberFname").val()=="" || $("#memberFname").val()=="") { alert('All fields are mandatory,Try again'); e.preventDefault(); } if (validate_Email(live_sender_email)) { alert('Good Luck!! your Member Email is valid, now you can continue..'); } else { alert('sorry Invalid Email Address'); e.preventDefault(); } }); }); function validate_Email(live_sender_email) { var expression = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; if (expression.test(live_sender_email)) { return true; } else { return false; } } </script> </body> </html>
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about jQuery Validate Email address using Regex Expression.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.