Wap/WML : Fill in forms
François Houste
Supplementary Tags
We still have two tags to learn before closing our discussion of WML forms:
<fieldset> and
<optgroup>. These tags are employed with text fields and multiple choice lists, respectively. They are used to group fields into different
categories.
Here is an example of how to use the
<fieldset> tag:
<p>
<fieldset title="login">
User name:<br/>
<input type="text" title="User name" name="Ident"/><br/>
Password:<br/>
<input type="password" maxlength="8" title="Password" name="Password" format="XXXXNNNN"/>
</fieldset>
</p>
The only attribute that can be assigned to this tag is
title. It defines a title for the group. But this title is seldom displayed on current mobile screens.
The
<optgroup> is used in the same way, but its visual effect is stronger:
<p>
Enter your choice<br/>
<select name="choice" multiple="true">
<optgroup title="group 1">
<option>Choice 1</option>
<option>Choice 2</option>
</optgroup>
<optgroup title="group 2">
<option>Choice 3</option>
<option>Choice 4</option>
</optgroup>
</select>
</p>
This is what the two groups of input fields will look like on your visitors' screen:
Figure 5: Grouping fields into several categories
Be careful when using option groups. Even if they enable you to make a preliminary sorting of the available options, they
require that visitors spend more time filling in your form. And communication with a WAP phone is still expensive!