Format attribute of WML input flag

Source: Internet
Author: User
Tags uppercase character

1. Format attribute of WML input flag
Any uppercase letter from A to Z with no numbers or other characters.
Lowercase letters from A to Z with no numbers or other characters.
N any number ranging from 0 to 9.
X any character from A to Z from 0 to 9.
X any character from A to Z from 0 to 9.
M any character. The input starts from uppercase by default.
M any character. The input starts from a small write by default.
* F (asterisk) means any number (including 0). F is the code in the format.
NF indicates the number of characters to be entered. N ranges from 1 to 9. F is the format code.
/Is the escape output character.

Formatting characters can be used in combination to represent a specific format input. However, a certain amount of input should be forced to avoid prompt information when the user fails. If the input is incorrect, the entered Area is left blank until you know what to enter. If you only want to enter a number and use "* n", the system will jump directly to the number input mode. If you only want to enter uppercase characters, use "* m" to switch to uppercase input mode. Here are some examples:
"N" only accepts one numeric character.
"* N" accepts any number characters.
"Nn" only accepts 2 numeric characters, not many.
"Ann" accepts an uppercase character (no number) followed by two numbers, not many.
"X * n" indicates that a single character (without a number) can be followed by any number of characters.
"Nnn/-Nnn/-NNNN" indicates that the phone number format in the United States is accepted, for example, "123-456-1234 ".
"2n/: 2n/: 2n" indicates the Accept time format, for example, "12:02:34 ".
"Nnnnnnnnn" indicates that nine numeric characters are accepted.
"9n" also indicates accepting 9 numeric characters.

The maxlength parameter controls the total number of input characters.

2. How to prevent an empty field?
In most cases, you need to know that the user has entered some content in the field and cannot leave the content blank. This can be done through detection on the server or WML.
In WML, this check can be completed by appropriate formatting code, you can also use a parameter named emptyok = "false" in the input tag (only required when the user input is required ). If value = "something" or value = "" is used, you can still send empty fields.
The following lines receive any value to the username field, and even the user clears the entire field. In addition, the field can submit a form without anything.
<Input name = "username" type = "text" value = "things" format = "* m"/>
Except that the user clears the entire field, the following rows receive any value to the username field. If field is empty, it cannot submit form ,.
<Input name = "username" type = "text" value = "things" format = "M * m"/>
The above applications are for most browsers. In Nokia 7110, The emptyok parameter can have the same effect:
<Input name = "username" type = "text" value = "things" format = "* m" emptyok = "false"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.