How's Form Validators Work

As usual, there are many ways to write any bit of JavaScript. Figure 11-11 shows the code that uses to validate its forms (also see Figure 11-1). This is only part of'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.'s form validator

Figure 11-11.'s form validator

Line-by-Line Analysis of Figure 11-11

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

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.