18. WCSS Input Extension

The input extension is consisted of two WCSS properties: -wap-input-format and -wap-input-required.

If you are familiar with WML mobile Internet application development, you will know that the <input> WML element contains the format attribute and the emptyok attribute. The format attribute defines the type and number of characters that a user can enter in an input field, and the emptyok attribute defines whether an input field can be left empty.

In XHTML MP, the format attribute and the emptyok attribute are not included in the <input> element any more and their corresponding function has been moved to WAP CSS. The -wap-input-format and -wap-input-required properties are used to replace the format attribute and the emptyok attribute respectively.

Some earlier mobile devices' WAP browser does not support the -wap-input-format and -wap-input-required WCSS properties, but supports the format attribute and the emptyok attribute as an extension to XHTML MP. If you want to ensure that your XHTML MP page functions correctly in the WAP browser of most mobile devices, you may want to include both the WCSS property and the WML attribute in the same element. For example,

<input type="text" format="N" style='-wap-input-format: "N"'/>

If both the -wap-input-format WCSS property and the format attribute (or the -wap-input-required WCSS property and the emptyok attribute) are specified in the same XHTML MP element and their values are different, the WCSS property takes precedence.

Previous Page Page 26 of 39 Next Page

Feedback Form (ExpandCollapse)

What do you think about this web page?

(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:

Please enter again to confirm:

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

A button for going back to the top of this page