Comment

unknown
Regex?,
February 15, 2010 at 8:10 AM

Why not just use a regular expression?

example (not tested):

var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.frm.txtEmail.value;
if(reg.test(address) == false)
{
alert ("Invalid email");
return false;
}
alert ("Valid email");
return true;
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
JavaScript Questions

JavaScript
 

Java Beginners

javascript
 

JavaScript Questions

Javascript
 

JavaScript Questions

javaScript
 

JavaScript Questions

javascript
 

JavaScript Questions

javascript
 

JavaScript Questions

JavaScript
 

JavaScript Questions

JavaScript
 

JavaScript Questions

javascript
 

Design concepts & design patterns Questions

javascript
 

Java Beginners

javascript
 

JavaScript Questions

javascript
 

JavaScript Questions

JAVASCRIPT
 

JavaScript Questions

Javascript
 

JavaScript Questions

javaScript
 

JavaScript Questions

javascript
 

JavaScript Questions

javascript
 

HTML Questions

Javascript
 

Design concepts & design patterns Questions

Javascript
 

Java Beginners

Javascript
 

JSP Interview Questions

javascript
 

Java Beginners

javascript
 

JSP Interview Questions

javascript
 

JavaScript Questions

javascript
 

HTML Questions

JavaScript
 

JavaScript Questions

javascript
 

Design concepts & design patterns Questions

Javascript
 

AOP Questions

javascript
 

Hibernate Interview Questions

javascript
 

Java Beginners

javascript
 

Java Beginners

javascript
 

Design concepts & design patterns Questions

Javascript
 

JSP Interview Questions

On Javascript
 

JavaScript Questions

JavaScript types
 

JavaScript Questions

javascript validation
 

JavaScript Questions

JavaScript and ECMAScript
 

JavaScript Questions

javascript doubt
 

Programming Tutorials

JavaScript - JavaScript Tutorial
 

Programming Tutorials

JavaScript - JavaScript Tutorial
 

JavaScript Questions

Prototypes for JavaScript
 

JavaScript Questions

Prototypes for JavaScript
 

JavaScript Questions

javascript and database
 

JavaScript Questions

javascript query
 

JavaScript Questions

javascript conversion
 

JavaScript Questions

validations in javascript
 

JavaScript Questions

javascript validation
 

JSP Servlet Questions

javascript validation
 

JavaScript Questions

What is JavaScript?
 

PHP Questions

Javascript and PHP
 

JavaScript Tutorial

JavaScript - JavaScript Tutorial
 

JavaScript Questions

Javascript Querry
 

Java Beginners

settimeout in javascript
 

JavaScript Questions

Acrobat Javascript
 

JavaScript Questions

timespan in javascript
 

XML Questions

javascript - XML
 

JavaScript Questions

JavaScript basic
 

Flex Questions

Javascript and flex
 

JavaScript Questions

JavaScript basic
 

JavaScript Questions

JavaScript basic
 

Programming Tutorials

Embedded JavaScript
 

JavaScript Questions

javaScript+Html
 

JavaScript Questions

javascript validation
 

Development process Questions

Javascript loops
 

JavaScript Questions

javascript issue
 

Development process Questions

javascript problem
 

JavaScript Questions

javascript confirm box
 

HTML Questions

JavaScript Form Validation
 

Framework Questions

javascript inheritance framework
 

JSP Interview Questions

Javascript array
 

Ajax Questions

javascript - Ajax
 

JavaScript Questions

javascript program
 

Design concepts & design patterns Questions

Javascript & jsp
 

JDBC Questions

Javascript - JDBC
 

Java Beginners

Javascript conflict
 

Design concepts & design patterns Questions

Javascript & jsp
 

Design concepts & design patterns Questions

Javascript & jsp
 

Design concepts & design patterns Questions

Javascript code
 

Design concepts & design patterns Questions

Javascript code
 

Development process Questions

Javascript code
 

JavaScript Questions

Question on javascript
 

HTML Questions

javascript validation
 

Development process Questions

Javascript code
 

HTML Questions

Issue with Javascript
 

JavaScript Questions

Javascript DOM
 

Java Beginners

javascript validation
 

Development process Questions

Javascript code
 

Design concepts & design patterns Questions

Javascript code
 

Design concepts & design patterns Questions

Javascript & jsp
 

JavaScript Questions

javascript dropdownlist
 

JavaScript Questions

JavaScript Comment Tag
 

JavaScript Questions

javascript comment syntax html
 

JavaScript Questions

javascript calendar popup code
 

Java Beginners

javascript dom error-message
 

JavaScript Questions

delete javascript object
 

HTML Questions

javascript regular expression
 

Java Interview Questions

javascript max size
 

JavaScript Questions

What is a JavaScript engine?
 

JavaScript Questions

Explain unescape() and escape() in JavaScript?
 

JavaScript Questions

How to create arrays in JavaScript?
 

JavaScript Questions

javascript null mean
 

Advertisements Advertisements
 

 

 

DMCA.com