back
Form Validation
One of the biggest applications for JavaScript in the real world is the use of forms. Forms are used extensively in on-line ordering. One of the problems with forms is that people will forget to fill in certain blanks. Imagine if you owned an on-line record store and someone ordered $300 worth of CDs and then forgot to put their e-mail address in the form. Luckily, we can automatically ensure that none of the important fields are left blank. The way we do this is by what we call "form validation," a technique by which JavaScript looks for blanks where there ought to be letters and numbers. Here is an example:

[Form Validation Example].

Assignment

Make a form that asks the user for ten pieces of information (text inputs). Write the necessary functions to ensure the user filled out all ten parts of the form. Use my example as a guide, but make up your own names for your functions.