Wednesday, October 15, 2014

Quiz 5

Although we are not actually submitting any form data to the server in this chapter, we did see the form tag attribute, to which we will have to give a value (the script to perform the actions we want to take place on our form data) when we eventually do submit the form data, and the name of that attribute is action.

Explain the similarities and differences between input elements of type radio and input elements of type checkbox, indicating as well where you would be most likely to use each.
First of all, the display of a “radio button” is a small empty circle that changes to contain a black disc when “selected” (clicked on by the user). This kind of input element (of type radio) appears in a group of similar buttons, and only one of them can be selected at any given time. Thus such a grouping is very useful when offering a number of options to the user, but only one of them may be chosen (that is, “mutually-exclusive” options). The “checkbox”, on the other hand, displays as a small box which is empty when not selected and contains (usually) a small check mark when selected. These input elements also appear, quite often, in a group of similar elements, but unlike a group of radio buttons, a group of checkboxes permits any number of the boxes to be checked. Such a grouping is therefore used when offering a number of options and any or all of them can be chosen. A single checkbox is also useful to ask a simple question to which there is a yes/no or true/false type of answer.

Why is the input element so important to the design and construction of web forms?
The input element for forms is so important because it alone accounts for the vast majority of the “widgets” or “form controls” one sees on a typical web page form. For example, just by changing the value of the type attribute of the input element, one gets either a text box, a checkbox, a radio button, a submit button, or a reset button. And these are just some of the possibilities. In fact, many forms can be constructed using only the form element itself, various kinds of input element, and perhaps a textarea element or two. The input element is thus the most versatile and useful of all the form controls available.

What is the purpose of using the fieldset/legend element combination?
We should always try to have the best possible user interface for our web pages, especially when we are using a form to gather information from our users. On a typical form there will be groups of “widgets” (“form controls”) that are collecting essentially the same kind of data (personal information, for example). Thus it makes sense to group those controls together on the form and provide a label that indicates their purpose. This is what the fieldset/legend element combo does for us. The fieldset element groups elements and places a box around those elements, and the content of the legend element appears in the upper left corner of that box as a label for the box and its contents.

If you want a one-line textbox to accept some information on a form you should use a/an _________________ element of type _________________.
input, submit

To get a dropdown list-box you would use a combination of
a select element, plus several option elements

When you use a fieldset element on a form, the text that appears in the top left corner to provide a descriptive name or phrase for the form controls that have been grouped, the text for that name or phrase is the content of a legend element

Placing an empty form element on a web page has no visible effect on the display of that page.
-True

If we want an input element of type checkbox to appear already checked when the form containing this checkbox is displayed, then that input element should have an attribute of the form checked="yes".
-False

To set the maximum number of characters (visible or not) that can be entered into the an input element of type text we use the attribute called
maxlength

If we give an input element of type text a size attribute with the value 15, the user will not be able to enter more than 15 characters into that text box.
-False

If we put an empty form element on one of our web pages and display that page in a browser, then where the form element is located we see
no visible effect

You can choose multiple options by clicking several buttons in a group of radio buttons.
-False

To set the number of characters that can be seen in the visible area of an input element of type text we use the attribute called
size

Although we are not actually submitting any form data to the server in this chapter, we did see the form tag attribute, to which we will have to give a value (the script to perform the actions we want to take place on our form data) when we eventually do submit the form data, and the name of that attribute is action

The for attribute of a label element will have the same value as the __________ attribute of an input element. ID

The adjective that applies to something in a markup (or other) language that should no longer be used (like the XHTML center tag) is ____________________.
deprecated

Explain the similarities and differences between an input element of type text and a textarea element, indicating as well where you would be most likely to use each.
Both the input element of type text and the textarea element are designed to accept text typed in by the user. The major difference is in the amount of text each is designed to accept, and therefore also in the typical uses for each. Typically, the input element of type text is used for a single line of text, and is therefore ideal for entering names, addresses, telephone numbers and the like. The number of characters that show in the text box display, as well as the maximum number of characters that may be entered, can be specified by the size and maxlength attributes, respectively. In the case of the textarea element, the rows and cols attributes specify the initial size of the display (in number of characters vertically and horizontally), but the element will also scroll to accommodate additional text entry if necessary. This element is used for multiline text entry, whatever the purpose.

Why is the input element so important to the design and construction of web forms?
The input element for forms is so important because it alone accounts for the vast majority of the “widgets” or “form controls” one sees on a typical web page form. For example, just by changing the value of the type attribute of the input element, one gets either a text box, a checkbox, a radio button, a submit button, or a reset button. And these are just some of the possibilities. In fact, many forms can be constructed using only the form element itself, various kinds of input element, and perhaps a textarea element or two. The input element is thus the most versatile and useful of all the form controls available.

You use the legend element to accompany the ______________ element.
fieldset

Which of the following types of input elements are generally used in a group?
radio and checkbox

Although we are not actually submitting any form data to the server in this chapter, we did see the form tag attribute, to which we will have to give a value (the script to perform the actions we want to take place on our form data) when we eventually do submit the form data, and the name of that attribute is action

If we give an input element of type text a size attribute with the value 15, the user will not be able to enter more than 15 characters into that text box.
-True

To set the maximum number of characters (visible or not) that can be entered into the an input element of type text we use the attribute called maxlength

If we want an input element of type checkbox to appear already checked when the form containing this checkbox is displayed, then that input element should have an attribute of the form checked="yes".
-False

If we put an empty form element on one of our web pages and display that page in a browser, then where the form element is located we see no visible effect.

“behind-the-scenes” logical grouping of a form control and the text that describes it (to help with accessibility) can be achieved using
a label element to contain the descriptive text, and the id attribute value of the form control to be the value of the for attribute of the label element

If you do not want any value to appear as a default option in a dropdown list-box, you should place an option element with no content (or a blank space) as the first option in the list of options within your select element. 
-True

Placing an empty form element on a web page has no visible effect on the display of that page.
-True

If you want an input element of type checkbox on your form to appear already checked when that form is displayed, you should give that input element a/an __________________ attribute with the value __________________.
checked, "checked" 

The text that you want to appear on the “submit button” on your form must be the _______________ of the _______________ attribute of a/an _______________ element of type _________________on your form.
value, value, input, submit 

When a user “submits” a form (that is, the data entered into the form) it is the value of the form's _________________ attribute that determines what is to be done with that data.
action

The adjective that applies to something in a markup (or other) language that should no longer be used (like the XHTML center tag) is ____________________.
deprecated

You use the legend element to accompany the ______________ element.
Fieldset

An input element of type text will scroll to allow a user to enter multiple lines of text.
False

If you want to get an opinion on something from your website visitors in the form of a paragraph to be typed into one of your forms, you should use
a textarea element















No comments:

Post a Comment