Assignment-2

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

Up ] Assignment-1 ] [ Assignment-2 ] Assignment-3 ]

Design an HTML form

An HTML form consists of various form elements (or controls) such as text fields, checkboxes, radio buttons, and so forth.

Your assignment is to design an input form with a wide variety of form elements (be sure to use either checkboxes or radio buttons and to use either menus or lists along with various textfields, etc.) This form will be used in the next homework assignment to write a CGI script. You may design your form about any topic that interests you. If you don't have a good idea, then you can do the employee data form below. Also, check the form below to make sure you understand how to do all the elements it discusses.

Note that in addition to the example above, there is a good tutorial specifically on forms on the HTML Resouces Page. Also, if you bought the WebMaster book, it discusses form tags in Chapter 10 on page 79.

One idea is to design an input form that accesses an employee database:

  1. Incorporate the following data-entry fields:
    first name
    middle name
    last name
    social security number
    department
    street address
    city
    state
    zip code
  2. Restrict the zip code to five characters.
  3. Use a pop-up menu to select the state. (Hint: You'll find a ready-made HTML form element for this purpose at URL
       http://www.whowhere.com/          which you can "borrow".)  Designate "New York" as the default state. 
  4. For the department field, make a set of radio buttons with a few department names to choose from.
  5. Provide buttons for the following actions:
    Add (add a new employee record)
    Find (find an existing employee record)
    Change (change an existing employee record)
    Clear (clear the input form)

Here's a short form to get your started:

Last name: SSN: --
First name: Middle name: