Chapter 7: Form Handling

Return to Chapter 7

 

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 Zip Codes

See it run: Validating Zip Codes

Script 7.14

This JavaScript validates a ZIP code field to make sure that it contains only numbers.