JavaScript

Developing a simple validation library in JavaScript: continued

This series of articles mainly lists some of the most commonly used JavaScript functions for client side validation of HTML forms. You can reuse these scripts to inject into server side controls easily.

All of the examples in this series can be directly tested by simply copying and pasting the entire code (of each section) into any text file with the extension .HTM, then opening it using a browser.

Validation for email addresses – another way

There exist several ways to deal with validation of email addresses. One of the most popular methods is using “regular expressions” (which I already discussed in my previous article). In this section, we shall deal with manual validation of email addresses.

Now, let us try to develop a simple script (JavaScript) to validate email addresses. Have a look at the following code: