|
|
|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98
- TYPE=text The INPUT element is a single-line text entry field. The SIZE attribute determines the width of the input box, in charactersthe default value is typically 20.
Note that with Netscape Navigator 3, you cannot use FONT elements to change the font size or font family of text displayed within form input elements (buttons or text input); However, with Netscape Navigator 4 or Internet Explorer 4, you can use either FONT or style sheets to modify the font style, size, or color of the text within the input field, to a limited degree. Please see Chapter 7 for details.
- USEMAP=url (optional; valid only with TYPE=image; not currently supported) Specifies a URL referencing a MAP element. When the user presses on the mapped image, the browser uses the MAP element to select a URL and sends the form content to the specified URL using the method indicated by the FORM element METHOD attribute. This is not supported on current browsers.
- VALUE=string (mandatory with TYPE=radio) Specifies the initial value of the input element. If absent, a null value is assumed. This is a mandatory attribute for TYPE=radio input elements.
- VSPACE=pixels (optional; valid only with TYPE=image; Netscape Navigator only) Specifies the space to be left above and below the image, in pixels.
- WIDTH=pixels (optional; valid only with TYPE=image) Defines the width of the image, in pixels. If the image is of a different size, it will be rescaled to fit the defined width. Authors should avoid resizing images, since this will distort the coordinates of the mouse pointer when the user clicks on top of the image.
Figures 6.21 through 6.24 give typical examples of INPUT element usage. FORM s are also discussed in Chapters 2 and 10.
SELECT Element: Select from Among Multiple Options
Usage:
| <SELECT> ... </SELECT>
|
Can Contain:
| OPTGROUP, OPTION
|
Can Be Inside:
| ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH,
|
| character highlighting, A, APPLET, IFRAME, LABEL, LEGEND, OBJECT
|
Attributes:
| CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
|
| onBlur, onChange, onFocus, (onSelect: Internet Explorer 4)
|
| DISABLED, MULTIPLE, NAME, SIZE, TABINDEX
|
SELECT contains a list of selectable string values, the values of which are specified by OPTION elements lying within the SELECT . A browser provides a way for the user to select from amongst these values: for example, a selectable list or pull-down menu. The attribute MULTIPLE permits selection of multiple values; otherwise, only one value can be chosen. As with INPUT elements, the selected data are sent as name/value pairs. The attributes are:
- DISABLED (optional; Internet Explorer 4 only) Disables user-control of the SELECT list. Also, the user cannot use the tab key to select this element. Furthermore, the data content of the element is not sent when the form is submitted to a server. This is currently only supported by Internet Explorer 4.
- MULTIPLE (optional) Allows the user to select multiple items from a single SELECT element. If MULTIPLE is absent, the user can select only a single item.
- NAME=string (mandatory) Specifies the variable name associated with the SELECT element.
- SIZE=number (optional) Specifies the number of displayed text lines to be presented. The default value is 1 and, consequently, a list is often presented as a pull-down menu. For other values, the list is usually presented as a scrollbox. If MULTIPLE is present, browsers choose a default SIZE greater than 1 (so that multiple selections are possible) and will not permit a smaller value, regardless of the value assigned to SIZE.
- TABINDEX=number (optional; Internet Explorer 4 only) Specifies the tabbing order for the linked region. By default, a user can use the tab key to switch between the various anchor elements, active images, and FORM input elements, starting from the top of the document and working down. TABINDEX lets an author change this default order and explicitly set the order of tabbing. Tabbing is ordered from the smallest integer to the largest integer. Elements with negative tabbing indices are never accessed in the tabbing sequence. This attribute is not supported on Netscape Navigator 4.
Figures 6.23 and 6.24 show typical examples of SELECT (and OPTION) elements.
OPTION Element: List of Options for SELECT
Usage:
| <OPTION> ... (</OPTION>)
|
Can Contain:
| characters
|
Can Be Inside:
| OPTGROUP, SELECT
|
Attributes:
| CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
|
| DISABLED, LABEL, SELECTED, VALUE,
|
OPTION sets the character-string options for a SELECT element. This element is not empty, but the terminating </OPTION> is optional, as the element is by default terminated by the next <OPTION> tag or by the </SELECT> tag ending the list. OPTION can contain characters, character references, or entity references only; it cannot contain markup. The content of OPTION is used as the value unless a VALUE attribute is explicitly set. In addition to the generic and event handler attributes, OPTION supports the following attributes:
- DISABLED (optional; not currently supported) Disables user-control of the OPTION. Also, the user cannot use the tab key to select this element. Furthermore, the data content of the element is not sent when the form is submitted to a server. Please see Chapter 7 for a detailed discussion of DISABLED.
- LABEL=string (optional; not currently supported) When OPTGROUP elements break a SELECT list into a hierarchical menu, then the regular label for the list item (set by the content of the element) may be too long. Thus, if hierarchical menus are used, the browser can use the value of the LABEL attribute to label each of the options, instead of the element content. LABEL is only relevant for OPTION elements inside an OPTGROUP. OPTGROUP is not currently supported.
- SELECTED (optional) This marks the OPTION as selectedby default, items are not selected. If the SELECT element has the MULTIPLE attribute, more than one OPTION can be marked as SELECTED. Figures 6.23 and 6.24 show examples. SELECTED items can be deselected by the user. Consequently, SELECTED is often used to set default selection values.
- VALUE= value (optional) Specifies the value assigned to the OPTION. If VALUE is absent, then the text content of OPTION is used as the value.
TEXTAREA Element: Text Input Region
Usage:
| <TEXTAREA>... </TEXTAREA>
|
Can Contain:
| characters
|
Can Be Inside:
| ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH,
|
| character highlighting, A, APPLET, IFRAME, LABEL, LEGEND, OBJECT
|
Attributes:
| CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
|
| onBlur, onChange, onFocus, onSelect
|
| COLS, DISABLED, NAME, READONLY, ROWS, TABINDEX, WRAP
|
|