option
optgroup
p
WML TAG: select
<select> ... </select>
The
select
tag is used to create a select list. A select list offers a selection of choices from which you may choose one or more items.
This tag delimits the beginning and end of the select list. It also serves as a container element for a collection of
option
elements where each
option
element contains one item to be displayed in the list.
Further, you can group related items (
option
elements) together into sub-listings using
optgroup
elements. The browser usually allows you to display one
optgroup
element at a time.
A
select
element cannot contain nested
select
elements. It can only contain
optgroup
and
option
elements.
Nested Tags: optgroup option
Attributes
class
The optional
class
core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e.,
Stocks
and
stocks
are not the same).
id
The optional
id
core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
iname
The optional
iname
attribute specifies the name of the variable that will be assigned the value of the index result. The index result is the position in the select list of the selected item. If multiple selections are permitted, the index result is a semicolon delimited list of the indices. The indexing starts at one. A zero signifies that no selection has been made.
ivalue
The optional
ivalue
attribute assigns a default value for the
iname
attribute. If the
iname
attribute already has a value, this attribute is ignored.
multiple
The optional
multiple
attribute is a Boolean value that specifies if the user can select single or multiple item in the select list.
False
permits selecting only a single item.
True
permits selecting multiple items. The default is
false
.
name
The mandatory
name
attribute is a string that specifies the name of the variable to which the results of the selection will be assigned.
tabindex
The optional
tabindex
attribute is an integer number greater than zero that sets the rank in the tabbing order for the current element. The rank dictates the order in which the elements in a single card will be traversed when tabbing.
title
The optional
title
attribute provides a string or text used to describe or provide additional information about the link.
value
The optional
value
attribute assigns the default value for the variable named in the mandatory
name
attribute. If the named variable has an assigned value, this attribute is ignored. If multiple selections are permitted, the values are specified in a semicolon delimited list.
xml:lang
The optional
xml:lang
attribute sets the language used in the element, such as English or Greek. For example, in the U.S. the default value is
en-US
.
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="ic" title="Ice Cream">
<p>
Click Select<br />
<select name="favorite" title="Pick your favorite!">
<optgroup title="Future Flavors">
<option value="cd">Coconut Delight</option>
<option value="cf">Coffee</option>
<option value="mns">Maple Nut Swirl</option>
<option value="rs">Raspberry Sorbet</option>
</optgroup>
<optgroup title="Unpopular Flavors">
<option value="cpr">Cinnamon Prune </option>
<option value="gb">Green Bean </option>
<option value="nunu">Nutty Nutmeg</option>
</optgroup>
</select>
</p>
</card>
</wml>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information