Computer Science 180
Web Design

Fall 2011, Siena College

Lecture 12: HTML Form Elements
Date: Wednesday, October 19, 2011

Agenda

Lecture Assignment 12

Due at the start of class, Friday, October 21.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to jteresco AT siena.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CS 180 Lecture Assignment 12, Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted.

Depending on the kind of information that is trying to be obtained from the user, different HTML form-related controls might be appropriate. For example, in the notes, we saw that a <select> with five <option>s is one way to choose one of the five teams in Major League Baseball's American League East division:

<select>
  <option value="yankees">Yankees</option>
  <option value="redsox">Red Sox</option>
  <option value="rays">Rays</option>
  <option value="bluejays">Blue Jays</option>
  <option value="orioles">Orioles</option>
</select>

Another reasonable option here might be a group of 5 radio buttons sharing the same name attribute.

Suppose you have a web site that needs to collect payment and shipping information from a user. Give an appropriate HTML element or elements that could be used to obtain each of these pieces of information:

  1. Customer name (1 point)
  2. Customer street address (1 point)
  3. Customer's gender (1 point)
  4. Credit card type (your business accepts Visa, Mastercard, American Express, or Discover) (2 points)
  5. Credit card expiration date (you do not accept expired cards, and you may assume credit card expiration dates are at most 4 years into the future) (3 points)
  6. Text to include on an enclosed gift card with shipment (1 point)
  7. Indicator whether customer has accepted the terms of service for the purchase (1 point)

Links