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 ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.