Email Address Validation- Using JavaScript validation statement we can check valid Email Address
E.g.
Check Output:
E.g.
<html>
<head>
<title>Email Validation</title>
</head>
<body>
Check email address entered is valid or not!
<form name="form1">
Enter Email Address:<input type="text" name="mail">
<input type="button" onclick="check()" value="Check">
</form>
<script language="javascript">
function check()
{
x=document.form1.mail.value;
if(x==0)
{
alert("No Email address entered" + "\n" + "\nIf you like this post then please \nshare it using share buttons \ngiven below")
}
else if(!((x.indexOf(".") > 0) && (x.indexOf("@") > 0)) || /[^a-zA-Z0-9.@]/.test(x))
{
alert("The Email address is invalid" + "\n" + "\nIf you like this post then please \nshare it using share buttons \ngiven below")
}
else
{
alert("Valid Email address entered" + "\n" + "\nIf you like this post then please \nshare it using share buttons \ngiven below")
}
}
</script>
</body>
</html>
Related Topics:
- JavaScript Introduction
- Variables in JavaScript
- JavaScript Function
- Accessing JavaScript Function
- Creating JavaScript interactive form
- Accessing form field value
- Creating interactive form login webpage
- Networking Fundamentals
- TCP/IP and Internet addressing
- Internet Working
- Internet Working Servers
- Concept and need for web publishing
- Web languages
- Javascript Control Structure
- Checking Text is Letter/s
- Checking Text is Number/s
- Checking Textbox is Empty or not
- Addition of two numbers
- Subtraction of two numbers
- Multiplication of two numbers
- Division of two numbers
- Form field validations
- Email validation