Validate an Email address is very important. This validation can be performed in many computer languages but today we are going to Validate Email with JavaScript.
2. What is
JavaScript Javascript is a scripting computer
language and its abbreviation is JS. It is
used to develop complex web
applications However it is always used
with CSS and HTML. It is different from
the Java computer language.
https://emailconcern.com
3. Why Validate
Email Address
In today’s world, most of the
important communication is done
through Email addresses. Collecting
email addresses is not only important
but it becomes essential when it
comes to Email Marketing. Therefore
validating the email address becomes
mandatory.
https://emailconcern.com
4. Structure of
Email Address
Consider this email address as a
sample ContactUs@EmailConcern.com. It is a
valid email address. Now it consists of 3 parts
1.Before @ :: It consists of the name of the
email address. This part consists of letters
(capital as well as small), numbers, and
special characters.
2.After @ :: It consists of a domain name so
here you can use (capital as well as small),
numbers, and special characters.
3.After dot :: It defines the type of the domain
like com, org, etc. In this part, only letters
(capital as well as small), numbers, and
dot(optional) can appear.
If any of the structures is violated the email
address becomes invalid.
https://emailconcern.com
6. Validate Email with JavaScript
<script>
function VALIDATE_EMAIL_ADDRESS() {
var email;
email = document.getElementById("EmailAddress").value;
var reg = /^([A-Za-z0-9_-.])+@([A-Za-z0-9_-.])+.([A-Za-
z]{2,4})$/;
if (reg.test(EmailAddress.value) == false)
{
https://emailconcern.com
9. Validate Email
with JavaScript
To test the above mention code I used W3School JavaScript
online editor. In this editor just paste the code into the editor
and press the Run button.
https://emailconcern.com
10. Conclusion
In order to collect valid email addresses, this validation is mandatory.
You cannot skip this step. It not only makes things easy for you but
also ensures data integrity.
https://emailconcern.com