short answer

 

Forms are often used on business Websites to collect data of various kinds (sales, memberships, mailing lists, etc.). The quality of the data is vital to the success of the business and its ability to use the data appropriately. Using JavaScript for form validation is one line of defense. Validation is often applied to check for a valid zip code, phone number, or product number. Another way JavaScript is applied in a form is to make entering the data easier (hint: focus).

For this thread, select two of the following potential form fields and write the JavaScript you would use to validate or make the data entry easier for the visitor:

  • U.S. phone number
  • Zip + 4
  • Social Security Number
  • A section that asks for the following:
    • First Name
    • Last Name
    • Street Address
    • City
    • State
    • Zip Code
  • Ordering a sweater that comes in any of the following colors:
    • Black
    • White
    • Gray
    • Blue
    • Red
Tags: No tags