TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
E-mail Validation In JavaScript
Delpin Susai Raj
Aug 22
2016
Code
628
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script type=
"text/javascript"
>
function
validate_email(field, alerttxt) {
with
(field) {
apos = value.indexOf(
"@"
);
dotpos = value.lastIndexOf(
"."
);
if
(apos < 1 || dotpos - apos < 2) {
alert(alerttxt);
return
false
;
}
else
{
return
true
;
}
}
}
function
validate_form(thisform) {
with
(thisform) {
if
(validate_email(username,
"Your UserName is Not Valid!"
) ==
false
) {
username.focus();
return
false
;
}
}
}
</script>
E-mail Validation
JavaScript