Chapter 6 – Creating a Form on a Web Page
MULTIPLE CHOICE
1. A(n) ____ control is any type of input mechanism on a form.
a.
variable
c.
parameter
b.
input
d.
form
2. Which of the following controls sends a form to a server for processing?
a.
enter
c.
send
b.
reset
d.
submit
3. Which of the following controls returns all input controls to the default status?
a.
clear
c.
reset
b.
empty
d.
new
4. Which of the following controls is identical to text fields used for single-line data entry?
a.
submit
c.
password
b.
textarea
d.
radio
5. Which of the following controls creates a drop-down menu of choices from which a visitor chooses?
a.
select
c.
menu
b.
option
d.
choice
6. Which of the following attributes, when used with the text tag, determines the number of characters
that display on a form?
a.
character
c.
width
b.
size
d.
dimension
7. The ____ attribute of the text tag specifies the maximum length of the input field.
a.
size
c.
maxlength
b.
limit
d.
control
8. A ____ input control is either a radio button, a check box, a Submit button, a Reset button, or a
selection menu.
a.
select
c.
capture
b.
data
d.
list
9. In a ____ box, a visitor may enter small amounts of text.
a.
capture
c.
text
b.
link
d.
textarea
10. The text control has two attributes: ____.
a.
cols and rows
c.
size and maxlength
b.
post and get
d.
width and height
11. In a radio control each choice is preceded by a radio ____.
a.
menu
c.
button
b.
bar
d.
either b or c
12. A radio button typically displays as which of the following?
a.
bullet
c.
small rectangle
b.
open circle
d.
none of the above
13. A ____ control creates a list item in a list from which only one item can be chosen.
a.
select
c.
list
b.
solo
d.
radio
14. The type=”____” attribute specifies that the type of control is the radio button.
a.
radio
c.
option
b.
check
d.
circle
15. With a checkbox control, the default can be changed so a particular check box is preselected as the
default, by using the ____ attribute and value within the <input> tag.
a.
chosen
c.
checked
b.
default
d.
preselect
16. The use of which of the following controls prevents the visitor’s having to type information into a text
field?
a.
text
c.
password
b.
textarea
d.
select
17. A(n) ____ control creates a selection menu of choices from which a visitor selects one or more
choices.
a.
select
c.
radio
b.
option
d.
checkbox
18. ____ controls are similar to text controls, except that they allow multiple lines of text input.
a.
Password
c.
Capture
b.
Textarea
d.
Either a or b
19. The textarea control has two primary attributes: ____.
a.
rows and cols
c.
size and width
b.
size and maxlength
d.
select and option
20. It is a good rule of thumb to keep the number of columns in a textarea to ____ or fewer.
a.
10
c.
25
b.
15
d.
50
21. The ____ attribute identifies the specific information that is being sent when the form is submitted for
processing.
a.
spec
c.
target
b.
name
d.
this
22. All controls except one have a ____ attribute.
a.
name
c.
value
b.
link
d.
select
23. The <____> tag defines the text that displays in the grouping borders.
a.
key
c.
cluster
b.
legend
d.
aggregate
24. The ____ attribute of the <form> tag indicates the URL for the action to be completed by the server.
a.
method
c.
action
b.
process
d.
http
25. There are two primary methods to send the form to the server to be processed: ____
a.
send and put
c.
get and put
b.
get and post
d.
CGI and HTML
26. Which of the following is a program written in a programming language (such as Perl) that
communicates with the Web server?
a.
HTML function
c.
URL imagemap
b.
CGI script
d.
post method
27. The ____ attribute of the <form> tag specifies the manner in which the data entered in the form is sent
to the server to be processed.
a.
process
c.
http
b.
server
d.
method
28. The two values of the ____ attribute in HTML are get and post.
a.
process
c.
http
b.
server
d.
method
29. The ____ method sends the name-value pairs to the end of the URL indicated in the action attribute.
a.
get
c.
post
b.
base
d.
serv
30. The size=“2” attribute means which of the following?
a.
two characters will appear, but more may be entered, depending on the maxlength attribute
b.
one character will appear, and the second will be truncated
c.
two characters will appear, and no more may be entered
d.
at most, two characters can be entered
31. The default type for the <input /> tag is a ____.
a.
radio button
c.
text box
b.
checkbox
d.
textarea
32. If no ____ attribute value is specified, a selection menu initially displays only one option, along with a
list arrow to view other choices in the list.
a.
default
c.
size
b.
choice
d.
checked
33. If a selection menu includes the size attribute with a value of 3, ____ choice(s) will appear in the
menu.
a.
one
c.
three
b.
two
d.
four
34. If the ____ attribute was not used to create a selection menu, the Web page visitor will be allowed to
select only one choice in the menu.
a.
several
c.
choices
b.
many
d.
multiple
35. Form controls are useless unless the information entered in the form can be submitted for ____.
a.
concatenation
c.
aggregation
b.
processing
d.
all of the above
36. Which of the following tags gives you the option of using an image for a Submit button, rather than
using the default button style?
a.
<option>
c.
<modify>
b.
<image button>
d.
<button>
37. The <form method=post action=mailto:ahs@isp.com> tag designates that the ____ method will be
used to send data to the appropriate location for processing.
a.
mailto
c.
post
b.
form
d.
action
38. Which of the following characters strings together all of the form responses?
a.
&
c.
@
b.
!
d.
%
39. Which of the following buttons deletes any data previously typed into text or textarea fields?
a.
New
c.
Clear
b.
Restore
d.
Reset
40. Which of the following attributes specifies a reset button?
a.
type=“option”
c.
reset=“type”
b.
master=“reset”
d.
type=“reset”
MULTIPLE RESPONSE
Modified Multiple Choice
1. Which of the following is a main component of a Web page form?
a.
input controls
c.
link to a major search engine
b.
<form> tag
d.
Submit button
2. A text input control is a ____ box.
a.
link
c.
password text
b.
textarea
d.
text
3. Which of the following controls creates a list item?
a.
checkbox
c.
list
b.
radio
d.
dropdown
4. A password always appears as a series of which of the following?
a.
characters
c.
bullets
b.
asterisks
d.
ampersands
5. When a Web page visitor clicks the Submit button on the form, which of the following is sent to be
processed?
a.
parameters of the control
b.
value of the data contained with the control
c.
dimensions of the field
d.
name of the control
MODIFIED TRUE/FALSE
1. A text control creates a text box that is used for a single line of input. _________________________
2. By default, all check boxes are pre-selected. _________________________
3. The reset input control sends the information from a form to the appropriate location for processing.
_________________________
4. A Web page form must include a Reset button. _________________________
5. The paragraph input control creates a multiple-line field for a relatively large amount of text.
_________________________
PTS: 1 REF: HTML 291
TRUE/FALSE
1. Using a Web page form for user input reduces the potential for errors because customers enter data or
select options from the form included directly on the Web page.
2. A select input control creates a series of check boxes for Web visitors to use.
3. The maximum length of a text field may exceed the size of the field that displays on the form.
4. Each choice in a check box list can be either on or off.
5. A checkbox control allows a Web page visitor to select only one choice from a list of choices.
6. Multiple radio buttons in the same group can be set to a checked state at the same time.
7. With check boxes, only one option can be selected at a time.
8. It is a good rule of thumb to use between 50 and 100 columns of text in a textarea field.
9. The resume and send controls create the Reset and Submit buttons.
10. A Web page form must include a Reset button.
11. For a textarea field, no value attribute is possible because of the variability of the input.
12. All options in a selection menu are contained within the <select> and </select> tags.
13. HTML5 includes new attributes for the <input /> tag.
14. The value attribute of the <input /> tag is optional for radio and checkbox controls.
15. Few Web sites use CGI scripts to process forms because this is an inefficient way to handle the data
that is sent to a form.
16. The get method sends the name-value pairs to the end of the URL indicated in the action attribute.
17. The post method is a program written in a programming language that communicates with the Web
server.
18. Information on forms can be sent by e-mail to an e-mail address or can be used to update a database.
19. A FORM script sends the information input on a Web page form to the Web server for processing.
20. If you specify a maximum number of characters that is greater than the number of characters specified
in the size attribute, the additional characters will be cut off.
21. If you do not specify a size attribute in the <select> tag, only one option is displayed, along with a list
arrow.
22. The <legend> tag within the fieldset tag is required.
23. An embedded style sheet changes the style for a single Web page.
24. You should validate the code after the form is completed and view and test it using your browser.
25. When you are collecting information from an online form, it is very important to test that the
information is accurate.
COMPLETION
1. A(n) ____________________ input control is either a text box, a textarea box, or a password text box.
2. In a(n) ____________________ text box, a visitor may enter a password.
3. In a(n) ____________________ box, a visitor may enter larger amounts of text.
4. The ____________________ attribute of the text control determines the number of characters that
display on the form.
5. A(n) ____________________ control tells the browser to send the data on the form to the server.
6. A(n) ____________________ control returns all input controls to the default status.
7. A(n) ____________________ control creates a list item in a list from which more than one item can
be chosen.
8. To set a particular radio button as the default, you use the ____________________ value within the
<input /> tag.
9. A(n) ____________________ button typically appears as an open circle.
10. The textarea control uses the ____________________ attribute to specify the number of columns in
the textarea field.
11. The ____________________ button sends the information to the appropriate location for processing.
12. The <____________________/ > tag defines the controls used in the form, using a variety of type
attribute values.
13. The <____________________> tag creates a form that allows user input.
14. The ____________________ method sends a separate data file with the name-value pairs to the URL
(or e-mail address) indicated in the action attribute.
15. When the ____________________ attribute specifies the same number of characters as the size
attribute, all characters entered by a user will appear in the text box.
16. To select multiple choices in a selection menu, a user must first select one choice and then press and
hold the ____________________ key while clicking other choices in the list.
17. To select several consecutive choices in a selection menu, a user must first select one choice and then
press and hold the ____________________ key while selecting the last choice.
18. The ____________________ button clears any input that was entered in the form, restoring the input
controls back to the initial values.
19. The ____________________ control helps to group related form elements together.
20. Using ____________________ is especially helpful in cases where some information is required and
some is optional.
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.
data input
f.
select
b.
checkbox
g.
textarea
c.
attributes
h.
password
d.
radio button
i.
select control
e.
input
j.
target
1. The use of asterisks, for example, to mark the entered text in this kind of field is designed to help
protect text from being observed as it is being entered
2. When one of these is selected, all of the other ones in the list are deselected automatically
3. This category of control eliminates a visitor’s having to type information into a text or textarea field
4. This kind of field is useful when an extensive amount of input from the Web page visitors is required
or desired
5. This kind of input control creates a list item
6. If a choice in a selection menu is highlighted, it means that this attribute has been used for that choice
7. This kind of control either can be a radio button, a check box, a Submit button, or a Reset button
8. These kinds of controls either are HTML tags or attributes of HTML tags
9. Nearly all of the HTML tags used to create forms have at most one of these each
10. This attribute of the <form> tag indicates the location at which a resource will display
ESSAY
1. Briefly list the HTML tags used to create forms, including their functions and any relevant remarks
about their use.
2. Explain in detail the difference between the action and method attributes of the <form> tag. Be sure to
include a definition of CGI script, and the get and post method in your explanation.
3. Describe in detail the four steps involved in creating an effective form.
CASE
Critical Thinking Questions
Case 6-1
Brendan is trying to familiarize himself in a hurry with the various form input controls. He has a sense
of the general function of each but not of the nuances among them.
1. What does Brendan learn is the key difference between the checkbox and radio controls?
a.
The checkbox control indicates both the size of the field and the total maximum length,
and radio control indicates neither.
b.
The checkbox control allows more than one item in a list to be chosen, and the radio
control indicates only one item in a list that can be chosen.
c.
The radio control allows more than one item in a list to be chosen, and the checkbox
control indicates only one item in a list that can be chosen.
d.
The radio control returns all input controls to the default status, and the radio button tells
the browser to send the data on the form to the server.
2. Brendan has a list of 30 different options for a user to select from a given list. Which of the following
controls is the best match for his need?
a.
select
b.
checkbox
c.
radio
d.
any of the above
Critical Thinking Questions
Case 6-2
Jacqueline is inheriting a segment of code from a developer who has left the firm. The problem is that
the code became corrupted on a portion of the server during a recent crash and she has to reconstruct a
lot of it.
3. One portion of the code Jacqueline is reconstructing includes a reference to the name attribute, but the
HTML tag is missing. Which of the following tags CANNOT be the tag in question?
a.
<input />
b.
<select></select>
c.
<option></option>
d.
<textarea></textarea>
4. Another portion of the code Jacqueline is reconstructing includes a reference to the readonly attribute.
Which HTML tag must be in use?
a.
<textarea></textarea>
b.
<option></option>
c.
<select></select>
d.
<legend></legend>