Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
16.6 Combo Boxes and List Boxes
409
16.6 Combo Boxes and List Boxes
A
SELECT
element presents a set of options to the user. If only a single entry
can be selected and no visible size has been specified, the options are pre
sented in a combo box (drop down menu); list boxes are used when multiple
selections are permitted or a specific visible size has been specified. The
choices themselves are specified by
OPTION
entries embedded in the
SELECT
element. The typical format is as follows:
...
The HTML 4.0 specification suggests the use of
OPTGROUP
(with a single
attribute of
LABEL
) to enclose
OPTION
elements in order to create cascading
menus, but neither Netscape nor Internet Explorer supports this element.
HTML Element:
Attributes:
NAME
(required),
SIZE
,
MULTIPLE
,
ONCLICK
,
ONFOCUS
,
ONBLUR
,
ONCHANGE
SELECT
creates a combo box or list box for selecting among choices. You
specify each choice with an
OPTION
element enclosed between
...>
and
.
NAME
NAME
identifies the form to the servlet or CGI program.
SIZE
SIZE
gives the number of visible rows. If
SIZE
is used, the
SELECT
menu is usually represented as a list box instead of a combo box. A
combo box is the normal representation when neither
SIZE
nor
MULTI
PLE
is supplied.
MULTIPLE
The
MULTIPLE
attribute specifies that multiple entries can be selected
simultaneously. If
MULTIPLE
is omitted, only a single selection is per
mitted.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved