Text
Fields in XHTML MP

Text
fields are used to obtain alphanumeric data from a user. The
following markup code creates a text field in XHTML MP:

<input
type="text" name="name_for_this_element"/>

The
default value of the type attribute is "text". So,
specifying a value for the type attribute is not a must in the
above XHTML markup.

The
maxlength attribute of the <input> tag limits the number
of characters that a user can enter in a text field. For example, a
user can enter at most 16 characters in a text field that are created
with this XHTML MP markup code:

<input
type="text" name="myTextField" maxlength="16"/>

You
can set a default value for the text field by using the value
attribute of the <input> tag. For example, the text field will
contain "Jack" by default if the previous markup code is
changed to:

<input
type="text" name="myTextField" maxlength="16"
value="Jack"/>

It
is a good practice to set an input mask to a text field. An input
mask restricts the type and number of characters that a user can
enter. The input mode (alphanumeric or numeric) of the mobile
device's keypad will be set automatically according to the input mask
value.

In
WML 1.x, the format attribute of the <input> element is
used to set an input mask. However, the format attribute does
not exist any more in XHTML MP. To specify an input mask in XHTML MP,
you need to use the -wap-input-format property of WAP CSS. For
example, the following style sheet specifies that a user can only
type at most ten numeric characters in text fields. A mobile device
will automatically switch its keypad to the numeric input mode for
the user to enter numeric characters.

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.