Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Practice exercises CHAPTER 7 331


C. required
D. user name


  1. When you want to send form data to the server to update data in the database, which
    HTTP method should you specify of the
    element?
    A. POST
    B. GET
    C. CONNECT
    D. SEND

  2. If you want to add a slider control to a webpage, which element do you use?
    A.
    B.
    C.
    D.


Practice exercises


If you encounter a problem completing any of these exercises, the completed projects can be
installed from the Practice Exercises folder that is provided with the companion content.

Exercise 1: Create a Contact Us form


In this exercise, you apply your HTML5 form and form validation knowledge by creating a
Contact Us page for the calculator application in the previous chapter. The webpage will
prompt the user for first and last name, email address, and nature of the communications. All
the fields will be required.


  1. Start Visual Studio Express 2012 for Web. Click FILE and choose Open Project. Navigate
    to the solution you created in Chapter 6, “Essential JavaScript and jQuery.” Select the
    WebCalculator.sln file and click Open.
    If you didn’t complete the exercises in Chapter 6, you can use the solution in the
    Chapter 7 Exercise 1 Start folder.

  2. In the Solution Explorer window, right-click the default.html file and choose Set As
    Start Page. Press F5 to verify that your home page is displayed.

  3. In the Solution Explorer window, copy the default.html page to a new HTML file by
    right-clicking the default.html file and choosing Copy. Right-click the WebCalculator
    project node and choose Paste.
    This creates a file named Copy of default.html.

  4. Right-click the new file and choose Rename.

  5. Name the new file ContactUs.html and press Enter.

Free download pdf