O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How Dictionary.com's Form Validators Work

As usual, there are many ways to write any bit of JavaScript. Figure 11-11 shows the code that Dictionary.com uses to validate its forms (also see Figure 11-1). This is only part of Dictionary.com's form validating script, and it's still pretty long. Don't let the code's length intimidate you—after all, you know 90 percent of it already.

Because you should understand most of it, I'll just cover the broad strokes and then point out a few details I haven't covered yet.

Dictionary.com's form validator

Figure 11-11. Dictionary.com's form validator

Line-by-Line Analysis of Figure 11-11

As I mentioned, this is only a small part of the Dictionary.com ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required