Wml-select-tag
提供:Dev Guides
WML <select>タグ
<select> … </select> WML要素は選択リストの定義に使用され、<option> … </option>タグは選択リストのアイテムの定義に使用されます。 一部のWAPブラウザでは、アイテムはラジオボタンとして表示されます。 <option> … </option>タグのペアは、<select> … </select>タグで囲む必要があります。
属性:
この要素は、次の属性をサポートしています。
Attribute | Value | Description |
---|---|---|
iname | text | Names the variable that is set with the index result of the selection |
ivalue | text | Sets the pre-selected option element |
multiple |
|
Sets whether multiple items can be selected. Default is "false" |
name | text | Names the variable that is set with the result of the selection |
tabindex | number | Sets the tabbing position for the select element |
title | text | Sets a title for the list |
value | text | Sets the default value of the variable in the "name" attribute |
xml:lang | language_code | Sets the language used in the element |
class | class data | Sets a class name for the element. |
id | element ID | A unique ID for the element. |
例:
以下は、この要素の使用法を示す例です。
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title="Selectable List">
<p> Select a Tutorial :
<select>
<option value="htm">HTML Tutorial</option>
<option value="xml">XML Tutorial</option>
<option value="wap">WAP Tutorial</option>
</select>
</p>
</card>
</wml>
このプログラムをロードすると、次の画面が表示されます。
オプションを強調表示して入力すると、次の画面が表示されます。
複数のオプションを選択するオプションを提供し、次のように_multiple_属性を_true_に設定します。
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title="Selectable List">
<p> Select a Tutorial :
<select multiple="true">
<option value="htm">HTML Tutorial</option>
<option value="xml">XML Tutorial</option>
<option value="wap">WAP Tutorial</option>
</select>
</p>
</card>
</wml>
これにより、次のように複数のオプションを選択する画面が表示されます。