Professional Documents
Culture Documents
This document is organized chronologically, using the same headings in blue that you see in
the textbook. Under each heading, you will find (in order): Lecture Notes that summarize
the section, Figures and Boxes found in the section (if any), Teacher Tips, Classroom
Activities, and Lab Activities. Pay special attention to teaching tips and activities geared
toward quizzing your students, enhancing their critical thinking skills, and encouraging
experimentation within the software.
Our latest online feature, CourseCasts, is a library of weekly podcasts designed to keep your
students up to date with the latest in technology news. Direct your students to
http://coursecasts.course.com, where they can download the most recent CourseCast onto
their mp3 player. Ken Baldauf, host of CourseCasts, is a faculty member of the Florida State
University Computer Science Department, where he is responsible for taking technology
classes to thousands of FSU students each year. Ken is an expert in the latest technology and
sorts through and aggregates the most pertinent news and information for CourseCasts so
your students can spend their time enjoying technology, rather than trying to figure it out.
Open or close your lecture with a discussion based on the latest CourseCast.
Table of Contents
Tutorial Objectives 3
Introducing Web Forms 3
Starting a Web Form 3
Creating a Field Set 4
Creating Input Boxes 5
Adding Field Labels 6
Designing a Form Layout 6
Defining Default Values and Placeholders 7
Entering Date and Time Values 8
Creating a Selection List 9
Creating Option Buttons 9
Creating Check Boxes 10
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 2 of 17
Tutorial Objectives
Students will have mastered the material in Tutorial Seven when they can:
BOXES
• Insight: Restricting Access to Web Server Programs (HTML 504)
FIGURES
• Figure 7-1, Figure 7-2
TEACHER TIP
Use Figure 7-1 to point out the different widgets and controls in a web form. Prepare a few examples
of the different types of web forms that can be created.
CLASSROOM ACTIVITIES
• Class Discussion:
Ask the students their views on whether allowing a user to directly interact with a
web page’s content instead of hyperlinks is a good practice or not.
LAB ACTIVITY
• None
• Explain the role of the action, method, and enctype attributes in a form.
• Discuss the possible values of the method attribute, including get and post.
• Use Figure 7-4 to discuss the values of the enctype attribute.
• Discuss the role of the script element.
BOXES
• Tip: HTML also supports the name attribute for uniquely identifying forms (HTML 504).
• Reference: Inserting a Web Form (HTML 504)
FIGURES
• Figure 7-3, Figure 7-4, Figure 7-5, Figure 7-6
TEACHER TIP
Inform the students about the placement of the form element within a web page.
List out the differences between the get and post methods in HTML.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: The method attribute has just one possible value in HTML. (Answer:
False)
o True/False: In HTML, the get method sends the form data in its own separate data
stream. (Answer: False)
LAB ACTIVITY
• Have the students use an editor of their choice to create a survey page using HTML and ask
them to add a form to it. Follow the instructions from the following section:
o HTML 505 “To insert a web form”
o HTML 506 “To specify how the form interacts with the server”
BOXES
• Reference: Creating a Field Set (HTML 508)
FIGURES
• Figure 7-7, Figure 7-8, Figure 7-9
TEACHER TIP
Inform the students that the id attribute is useful in distinguishing one field set from another, but it
is not compulsory to add it to a field set. Inform them that field sets act like block elements that can
expand or shrink to accommodate their content.
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 5 of 17
Explain the students that field sets are generally useful in assistive technologies. Cite the example of a
screen reader in this aspect.
CLASSROOM ACTIVITIES
• Class Discussion:
Ask the students to express their opinion on why field sets and legends are required when
creating a form? Also, ask them to justify their answers with examples.
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Ask them to organize the
form into two field sets and add legends to them. Follow the instructions from the following
section:
o HTML 508 “To add field sets to a form”
o HTML 509 “To add legends to the field sets”
BOXES
• Reference: Creating an Input Control (HTML 511)
• Tip: You can prevent users from entering data into a control by adding the attribute
disabled to the element tag (HTML 513).
• Insight: Navigating Forms with Access Keys (HTML 513).
• Tip: Always include a type attribute in your input box so that a user’s device can choose a
keyboard best suited for the form control (HTML 514).
FIGURES
• Figure 7-10, Figure 7-11, Figure 7-12, Figure 7-13
TEACHER TIP
Inform the students that if no type value is specified for the input element, the browser assumes a
default value of text and adds a simple text input box to the web form. Also, tell them that by
default, browsers display input boxes as inline elements.
Remind the students that in virtual keyboards, for email addresses the @ key is displayed as well as a
key that inserts the .com character string. Similarly, for url data, the virtual keyboard includes a key
that inserts the www. character string.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: By default, the length of input boxes is 20 characters. (Answer: True)
o Quiz: Which attribute of the input element identifies the control in which a user
enters the field value? (Answer: id)
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 6 of 17
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Ask them to add multiple
input elements to the survey form. Follow the instructions from the following section:
o HTML 512 “To add input elements”
BOXES
• Reference: Creating a Field Label (HTML 515)
FIGURES
• Figure 7-14
TEACHER TIP
Remind the students that by nesting a control within a label, both the control and its label can be
treated as a single object.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: The for attribute is not required when the association between a text
string and a control is implicitly made. (Answer: True)
o True/ False: You can use only one approach at a time to associate a text string with a
control. (Answer: False)
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Ask them to associate
text strings to input boxes. Follow the instructions from the following section:
o HTML 515 “To insert form labels”
BOXES
• Tip: In a two-column layout, you can move the label text even closer to the input controls by
right aligning the label text (HTML 517).
• Insight: Using the autocomplete Attribute (HTML 522)
FIGURES
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 7 of 17
• Figure 7-15, Figure 7-16, Figure 7-17, Figure 7-18, Figure 7-19, Figure 7-20, Figure 7-21
TEACHER TIP
Inform the students that the width of individual characters varies depending on the typeface and the
font style.
CLASSROOM ACTIVITIES
• Class Discussion:
Ask the students to select a form layout they think is suitable for a survey conducted on
100 people about their preferences and choices. Also, ask them to justify their answers.
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 517 “To create a flexbox for the label and input elements”
o HTML 518 “To add styles for a flexible form layout”
o HTML 520 “To create a flexible layout for the form”
BOXES
• Tip: You can replace the default field value by entering a new value for the field (HTML 523).
• Tip: The moz extension for Firefox version 18 and earlier treats the placeholder as a pseudo-
class rather than a pseudo-element (HTML 525).
• Proskills: Decision Making: Creating Cross-Browser Compatible Forms (HTML 526)
FIGURES
• Figure 7-22, Figure 7-23, Figure 7-24
TEACHER TIP
Remind the students that different browser extensions cannot be placed within the same style rule
because if the style rule contains a selector that the browser doesn’t recognize, the entire rule will be
ignored.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: Placeholders provide a hint about the kind of data that should be entered
into a field in HTML. (Answer: True)
o True/ False: CSS provides specific styles to format the appearance of placeholders.
(Answer: False)
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 8 of 17
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 523 “To define a default field value”
o HTML 524 “To define a placeholder”
BOXES
• Tip: If a browser does not support date and time controls, it will display an input box, leaving
the user free to enter the date or time value in whatever format he or she wants (HTML 530).
FIGURES
• Figure 7-25, Figure 7-26
TEACHER TIP
Inform the students that the lack of uniformity in date formats makes it difficult for a web server
program to store and analyze the data. Provide them with a few real-time scenarios where this
situation is applicable.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: In HTML, there is nothing to prevent users from entering the same date
in a wide variety of formats. (Answer: True)
o True/ False: In HTML5, the date and time fields can be indicated only by using the
time attribute. (Answer: False)
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 531 “To create a date field”
BOXES
• Reference: Creating a Selection List (HTML 532)
• Tip: The default width of the selection box is equal to the width of the longest option text
unless the width is set using a CSS style. (HTML 532).
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 9 of 17
• Tip: To assist your users in completing your form, you can include instructions on your page
detailing how to select multiple options from a selection list (HTML 534).
• Insight: Hidden Fields (HTML 536)
FIGURES
• Figure 7-27, Figure 7-28, Figure 7-29, Figure 7-30, Figure 7-31
TEACHER TIP
Remind the students that the first option in a selection list is selected by default and thus contains the
field’s default value. Also, inform the students that XHTML documents require the attribute
selected = “selected” to be compliant with XHTML standards for attribute values.
Inform the students that if they are using multiple selection lists in a form, they need to verify
whether the server-based program they are using can handle a single field with multiple values.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: The default behavior of a selection list is to allow multiple selections from
the list of options. (Answer: False)
o True/ False: In HTML5, there is no CSS style to change the appearance of the option
group label alone. (Answer: True)
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 532 “To create a selection list”
o HTML 534 “To apply the size and multiple attributes”
BOXES
• Tip: To show that a group of radio buttons are associated with the same field, place the radio
button controls within a field set (HTML 537).
• Reference: Creating an Option List (HTML 537)
FIGURES
• Figure 7-32, Figure 7-33
TEACHER TIP
Prepare a few examples to show the difference between selection lists and radio buttons. Also, inform
the students that radio buttons with different ids and field values can share the same field name.
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 10 of 17
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: A user can check multiple options in a group of radio buttons. (Answer:
False)
o True/ False: In HTML5, an option button is always selected by default. (Answer: False)
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 538 “To create a set of option buttons”
BOXES
• Tip: The default field value for a check box control is “On” (HTML 540).
• Reference: Creating a Check Box (HTML 540)
• Insight: Tab Indexing and Autofocus (HTML 541)
FIGURES
• Figure 7-34, Figure 7-35
TEACHER TIP
Prepare a few examples to show the use of check boxes in HTML. Inform the students that check
boxes are a good option to be selected when they want their visitors to choose multiple units within a
group of choices.
CLASSROOM ACTIVITIES
• Class Discussion:
Ask the students to express their views on the necessity of using checkboxes. Can there be
any other alternative to using checkboxes in HTML? Ask them to justify their answers.
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 540 “To add the checkbox control”
BOXES
• Tip: When you enter more text than can fit into a text area box, the browser automatically
adds vertical scroll bars to the box (HTML 542).
• Reference: Creating a Text Area Box (HTML 542)
• Proskills: Written Communication: Creating Effective Forms (HTML 544)
FIGURES
• Figure 7-36, Figure 7-37, Figure 7-38
TEACHER TIP
Prepare a few examples to show the limitations of input boxes. Next, show a few examples depicting
how text area boxes are appropriate for extended text strings.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: The default browser style is to create a text area box of about 240
characters wide. (Answer: False)
o True/ False: In HTML, the size of a text area box cannot be increased. (Answer: False)
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 543 “To add a text area box”
BOXES
• Reference: Creating Spinner Controls and Range Sliders (HTML 551)
• Insight: Styles for Widgets (HTML 553)
FIGURES
• Figure 7-39, Figure 7-40, Figure 7-41, Figure 7-42, Figure 7-43
TEACHER TIP
Prepare a few examples to explain how spinner controls and slider controls work.
Also, inform the students that it a good practice to include the lower and the upper values of the
range before and after the slider control as many browsers do not include a scale on the range slider
widget.
CLASSROOM ACTIVITIES
• Quick Quiz:
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 12 of 17
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 548 “To add a spinner control”
o HTML 551 “To add a range slider control”
BOXES
• Tip: When applied to the range type, a data list appears as tick marks in the range slider
widget (HTML 553).
• Reference: Creating and Applying a Data List (HTML 554)
FIGURES
• Figure 7-44, Figure 7-45
TEACHER TIP
Inform the students that the datalist tag is a new tag added in HTML5. Remind them that the
datalist element is used to specify a list of pre-defined options in an input box, and it appears as a
pop-up list of suggested values.
CLASSROOM ACTIVITIES
• Class Discussion:
Ask the students to research on the global attributes supported by the datalist
element in HTML.
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 554 “To apply a data list to an input control”
BOXES
• Reference: Creating Form Buttons (HTML 556)
FIGURES
• Figure 7-46, Figure 7-47, Figure 7-48
TEACHER TIP
Prepare a few examples to show the students the difference between the command, submit, and reset
buttons.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: The appearance of command, submit, and reset buttons is determined by
the browser. (Answer: True)
o True/ False: The button border and the font of a submit button can be modified only
after adding the button element. (Answer: True).
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 557 “To create submit and reset buttons”
BOXES
• Tip: You can turn off client-validation by adding the attribute novalidate to the form
element (HTML 559).
• Reference: Validating Field Values (HTML 563)
• Insight: WebKit Styles for Validation Messages (HTML 565)
FIGURES
• Figure 7-49, Figure 7-50, Figure 7-51, Figure 7-52, Figure 7-53
TEACHER TIP
Remind the students that whenever possible, they should supplement server-side validation with
client-side validation to reduce the server’s workload.
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 14 of 17
Inform the students that the maxlength attribute does not distinguish between characters and
digits. A user could enter the text string abcde as easily as 32175 and have the field values pass
validation.
CLASSROOM ACTIVITIES
• Quick Quiz:
o True/ False: If a required field is left blank, the browser will return an error message
without submitting the form. (Answer: True)
o True/ False: The confirmation dialog box appears every time you submit a form.
(Answer: False)
LAB ACTIVITY
• Have the students rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 560 “To create submit and reset buttons”
o HTML 561 “To verify the form does not accept invalid data”
o HTML 563 “To test a field value against a regular expression”
BOXES
• Proskills: Problem Solving: Using Form Building Tools (HTML 569)
FIGURES
• Figure 7-54, Figure 7-55, Figure 7-56, Figure 7-57, Figure 7-58
TEACHER TIP
Inform the students that according to studies, users are less likely to make errors and can complete a
form faster if they are informed of data entry errors as they occur.
Remind the students that it is a good practice to highlight invalid field values only when the
respective input controls have the focus as displaying a form full of input backgrounds with different
background colors can be confusing and distracting for a user.
CLASSROOM ACTIVITIES
• Class Discussion
Ask the students to express their opinion on whether an inline validation is better
than an after submit validation? Ask them to justify their answers.
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 15 of 17
LAB ACTIVITY
• Ask the students to rework on the previous HTML file they created. Follow the instructions
from the following section:
o HTML 566 “To create style rules for elements that have the focus”
o HTML 568 “To perform inline validation”
New Perspectives on HTML and CSS, 7th edition Instructor’s Manual Page 16 of 17
Glossary
• access key (HTML 513) • Perl (HTML 504)
• calendar controls (HTML 502) • placeholders (HTML 524)
• check boxes (HTML 502) • post method (HTML 505)
• client-side validation (HTML 559) • radio buttons (HTML 502)
• color pickers (HTML 502) • regular expression or regex (HTML 562)
• command button (HTML 556) • reset button (HTML 556)
• Common Gateway Interface (CGI) (HTML • selection lists (HTML 502)
504) • server-side validation (HTML 559)
• controls (HTML 502) • slider control (HTML 550)
• data field or field (HTML 503) • slider controls (HTML 502)
• data list (HTML 553) • spin boxes (HTML 502)
• field set (HTML 507) • spinner control (HTML 548)
• focus (HTML 566) • submit button (HTML 556)
• form buttons (HTML 556) • text area boxes (HTML 502)
• get method (HTML 505) • validation (HTML 559)
• hidden field (HTML 536) • virtual keyboards (HTML 514)
• inline validation (HTML 565) • web form (HTML 502)
• input boxes (HTML 502) • widgets (HTML 502)
• option buttons (HTML 502)
Top of document