Chapter 8: Forms and Regular Expressions

Return to Chapter 8

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Validating an Email Address with Regular Expressions

See it run: Validating an Email Address with Regular Expressions

Script 8.1

This JavaScript, like Script 7.15, validates e-mail addresses. But because it uses regular expressions, the script is much shorter.

Script 8.2

This is the HTML file for the e-mail validation example.