wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML Forms - CIW SDA Lesson 6

Total questions: 26

Worksheet time: 20mins

Name
Class
Date
1.
Jane has created a Web form for users to submit information to his Web site. A CGI script helps process and store the data in a database. Which attribute of the form field elements in Janes' Web form will perform the task of organizing user information into name=value pairs?
a)
method
b)
name
c)
value
d)
form
2.
Which technology resides on a server and receives Web form data from the browser, then processes the data into human-readable format?
a)
CGI
b)
HTTP
c)
XML
d)
HTML
3.
A user has accessed your company's Web server with her Web browser. Which choice lists the necessary elements for a CGI session to occur in this scenario?
a)
A CGI script, a Web form, and a database server
b)
A Web form, a Web server with a CGI interpreter, and a separate database server
c)
A CGI script, a Web form, and a Web server with a CGI interpreter
d)
A Web form and a database server
4.
Consider the following code for a text box in a Web form:
<input type="text" name="UserName"/>
Which modified tag should you use if you want the text box to appear with default text that reads "Enter Name Here"?
a)
<input type="text" name="UserName" value="Enter Name Here"/>
b)
<input type="name" text="Enter Name Here" value="text"/>
c)
<input type="area" value="default" text="UserName"/>
d)
<input type="text" name="UserName" default="Enter Name Here"/>
5.
Your company Web site uses a Web form to collect data from a user. The user has entered data into the form fields and will soon click the Submit button, then the data will be sent to a database. Which of the following passes information from the Web form to the database server?
a)
A CGI script
b)
A Perl script
c)
A database
d)
An e-mail server
6.
You are creating a Web form in HTML5 for your site. You want to make sure you code it correctly to process data. You have included the action attribute in the <form> element. What else do you need to include?
a)
The method attribute of the <input> element
b)
The method attribute of the <form> element
c)
The type attribute of the <form> element
d)
The type attribute of the <input> element
7.
Which line of HTML code creates a scrolling text box that can display three rows of text that are each 30 characters long?
a)
<input type="textarea" name="comments" width="30" rows="3"/>
b)
<input type="text" name="comments" chars="30" rows="3"/>
c)
<text name="comments" width="30" rows="3">
d)
<textarea name="comments" cols="30" rows="3">
8.
In the Web form you are creating, you want a multiple-option select list to appear with five options. Which line of HTML code will help accomplish this?
a)
<input type="select" name="work" multiple="yes" default="5"/>
b)
<select name="work" multiple="multiple" size="5">
c)
<select name="work" size="5">
d)
<input type="multiselect" name="work" default="5"/>
9.
Which line of HTML code begins a single-option select list?
a)
<select name="listName">
b)
<input type="select" name="listName" multiple="0"/>
c)
<select name="listName" multiple="no">
d)
<input type="select" name="listName"/>
10.
Your company's intranet Web server has crashed. You must help re-create the server. A server administrator has copied a CGI script from last night's backup tape. The server is an exact duplicate of the server that just crashed. However, this script will not process information on the new server. What is most likely the problem on the server?
a)
Executable permissions have not been set correctly.
b)
The Web server cannot support the script.
c)
The firewall is blocking the CGI script's transmissions.
d)
The script is responsible for the crash of the original Web server.
11.
Consider the following example code from a Web form:
How often do you want to be updated about Habitat for Humanity?
<select name="Frequency">
<option> Once a month </option>
<option> Once a quarter </option>
<option> Once a year </option>
<option value="NotAtAll"> Never </option>
</select>
Which Web form field will this code create?
a)
A single-select drop-down list
b)
A group of check boxes
c)
A group of radio buttons
d)
A multiple-select drop-down list
12.
In an HTML form, what is the purpose of the name attribute in an <input> tag?
a)
It identifies the form input received in a name=value pair by the site's administrator.
b)
It is required for the form to render in all browsers.
c)
It labels the form field so the user knows the type of input expected.
d)
It identifies the type of field or button that will appear in the form.
13.
Consider the following example code from a Web form:
What is your favorite hobby?
<select name="Hobby">
<option> Kayaking </option>
<option> Swimming </option>
<option> Fishing </option>
<option value="NoneAbove" > None of the Above </option>
</select>
You have been directed to change this form field so that users can select more than one option from this list. In addition to rewording the page text, which change must you make to the code?
a)
Create a drop-down list, remove all references to the <select> element, then replace <option> with <list>.
b)
Remove the <select> element and replace it with the <list> element.
c)
Change the <select name="Hobby"> tag to <select list="Hobby>.
d)
Add the multiple="multiple" attribute and value to the <select> element.
14.
Which line of HTML code creates a multiple-option select list in a Web form?
a)
<input type="select" name="work" multiple="multiple" size="4"/>
b)
<select name="work" multiple="multiple" size="4">
c)
<select multiple="selectlist" name="work" size="4">
d)
<input type="select" name="work" multiple="yes" size="4"/>
15.
You are creating form fields in a Web page. Which attribute should you include in the <input> element to specify the type of form fields that will appear in the form?
a)
The action attribute
b)
The type attribute
c)
The value attribute
d)
The name attribute
16.
Which line of code creates a text box in a Web form that will validate as HTML5?
a)
<input type="text" name="UserName"/>
b)
<input type="text" name="UserName">
c)
<input text="area" name="UserName"/>
d)
<input type="area" text="UserName">
17.
Which attribute of the <form> element is used to specify the way that user-entered Web form data will be sent to the Web server?
a)
The get attribute
b)
The post attribute
c)
The method attribute
d)
The action attribute
18.
Which <form> element attribute and value specify that the browser will send data to the Web server location specified by a URL?
a)
action="get"
b)
action="post"
c)
method="post"
d)
method="get"
19.
When creating a Web form in HTML, what is the purpose of the name attribute?
a)
It acts as a comment, informing the data recipient about name of the end user sending data.
b)
It acts as a comment, informing the data recipient about the name of the Web form's creator.
c)
It identifies data sent from the database to the e-mail server to inform the data recipient about the sending application.
d)
It identifies data received from a user and associates it with a value specified by the form's creator.
20.
Which <form> element attribute and value is considered to be the most secure when sending data?
a)
method="get"
b)
action="post"
c)
action="get"
d)
method="post"
21.
If a Web page author wants her users to select only one option among several specified on a form, which input type should she specify?
a)
Radio buttons
b)
Check boxes
c)
A text box
d)
A Reset button
22.
User-entered information has been passed from a Web form to a database server. Where is the CGI script located?
a)
In the network firewall
b)
On the user's hard drive
c)
On the database server
d)
On the Web server
23.
What is the basic element of a raw text string sent from a Web form to a Web server's CGI script?
a)
A name=value pair
b)
An action value
c)
An environment variable
d)
A method value
24.
In an HTML form, the <input> tag is used to:
a)
create lists of choices from which users make selections.
b)
create text boxes, radio buttons and Submit buttons.
c)
create a text box for users to write longer comments.
d)
collect all input and combine it into a query string.
25.
Your Web team manager has directed you to create a Web form that allows the user to upload a file to your Web server. Which line of HTML code would accomplish this task?
a)
<input file="put" name="File"/>
b)
<input type="file" name="File"/>
c)
<input value="file" name="File">
d)
<input type="upload" name="File">
26.
Which line of code will create a Web form check box that will validate as HTML5?
a)
<input type="checkbox" name="groupName"/>
b)
<input type="check" name="groupName"/>
c)
<input type="checkbox" name="groupName">
d)
<input type="check" name="groupName">