Home > Articles > Open Source > Ajax & JavaScript

  • Print
  • + Share This
This chapter is from the book


Test your knowledge of JavaScript's form objects by answering the following questions.


  1. Which of these attributes of a <form> tag determines where the data will be sent?

    1. ACTION

    2. METHOD

    3. NAME

  2. Where do you place the onSubmit event handler to validate a form?

    1. In the <body> tag.

    2. In the <form> tag.

    3. In the <input> tag for the Submit button.

  3. What can JavaScript do with forms that a CGI script can't?

    1. Cause all sorts of problems.

    2. Give the user instant feedback about errors.

    3. Submit the data to a server.


  1. a. The ACTION attribute determines where the data is sent.

  2. b. You place the onSubmit event handler in the <form> tag.

  3. b. JavaScript can validate a form and let the user know about errors immediately, without waiting for a response from a server. (If you use server-side JavaScript, you can also submit the data to the server, but that's another story.)

  • + Share This
  • 🔖 Save To Your Account