Email Validate Script

Electronic mail is simple shortened email which is also sometimes will write as e-mail.The protocol receiving, sending, and storing electronic messages is called the email.

Demo :

In this Email validate Script is used to validate all type of email address. you can try this demo here.



Type Email Id :

Example :

demo@tutorialsscripts.com

Code :

If you need to validate email address following code helpful to you.


function validate(frm_email,email)
{
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    var address = document.forms[frm_email].elements[email].value;
      if(reg.test(address) == false)
      {
         alert('This is invalid Email Address');
         document.frm_email.email.value='';
         document.frm_email.email.focus();
         return false;
      }
      else
      {
        alert('This is valid Email Address');
        return false;
      }
}

In the above java script function is used to validate for email. This function is called with two argument one is frm_email another one email.if the email address is invalid in the java script return false function will be returned 'Invalid Email Address' message through alert.

<form id="frm_email" method="post" action="" onsubmit="javascript:return validate('frm_email','email');">
<input type="text" id="email" name="email" />
<input type="submit" value="Submit" />
</form>

In the above form is used to validate the correct email address.when click submit button in the java script will execute and validate email address .

Free Download Script:

If you need to Email validate Script click and download from following zip file.

Download -->




Content