Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Email validation in javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 153
    Comment on it

    If you are creating web forms then you need to put the validation in your form. We are here to discuss the validation for email. We know email address has its own structure. For eg. or etc

    We are going to share a script in javascript for email validation. Please have a look.

    function customerData(){
    var email_id = document.getElementById('customer_email').value;
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(email_id)){
        return true;
        alert('Kindly fill out the correct email address');
        return false;
    <form method="post" onsubmit="return customerData();">
    <input type="text" name="customer_email" id="customer_email" placehoder="Enter your email address" />
    <input type="submit" name="process_user" />

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: