Skip to main content

Javascript to validate Email Expression

Using regular expressions is probably the best way. Here's an example (live demo):
function validateEmail(email) {
    var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    return re.test(email);
}
But keep in mind that one should not rely only upon JavaScript validation. JavaScript can easily be disabled. This should be validated on the server side as well.

Comments

Popular posts from this blog

Advantages of E-Commerce

Electronic Commerce increases Profits : Electronic commerce increases sales and decrease costs. Advertising on the web reaches all the users of that website. A firm can use the web to reach communities which are scattered geographically. The web's natural advantage is that it is low cost medium for disseminating information and processing transaction. for e.g the cost of advertising on the web is much less as compared to advertising in a newspaper. Another benefit of web based commerce is that information based industries excel here. A virtual organisation increases efficiency through the automation of processes. The cost of handling sales inquiries and determining product availability can be reduced with the help of e-commerce in the marketing process of the business. E-commerce increases the speed and accuracy with which businesses can exchange information which reduces costs on both sides of transactions. Another Advantage of e-commerce is ...

Unified Modeling Language- (UML)

Brief Background UML is a language for specifying,visualizing ,documenting and constructing the artifacts of software systems,as well as for business modeling and other non-software systems. UML has been developed by Grady  Booch, James Rumbaugh and Ivar Jacobson. Goals of UML are : To model systems using Object oriented concepts. To establish an explicit coupling to conceptual as well as executable artifacts To address the issues of scale inherent in complex , mission critical systems. To create a modeling language that can be used by humans as well as machines.  Understanding the thirteen diagrams of UML 2.x is an important part of understanding OO development. Although there is  far more to modeling than just the UML  the reality is the UML defines the standard modeling artifacts when it comes to object technology. There are three classifications of UML diagrams: Behavior diagrams . A type of diagram that depicts behavioral features of a ...

Web Page with HTML

HyperText Markup Language HTML can be used to display any type of document that is available on the web. The computer that maintains the document (host computer) and the computer that displays the document may be at different geographical locations.HTML is a versatile language and can be used on any platform or desktop. Being platform independent documents written in HTML can be viewed on any platform. HTML elements are used to markup the document and inform the browser like Microsoft  Internet Explorer , about the action to be taken when a certain element is specified. Features of HTML HTML allows us to: Provide tags to make the document look attractive. Tags are used to represent the various elements of a Web page, like titles and images. Use graphics and display text in different fonts, sizes and color. You can enhance the presentation of the document using these elements. Create Hyper text links, also known as hyperlinks, to other documents or other portions of the...