Tutorials | show
HTML-like <FORM>,<fieldset> can be used to include a set of form options, but not necessarily. As I said before, when the <card> ordered is set to false, the phone can display a summary card to summarize the effective options to facilitate the user to select the form option to fill out, the summary of the tab is based on <fieldset> and independent input box <input> and menu <select> to summarize. Syntax is, <fieldset title= "label" > Form content </fieldset>, the optional title property, in addition to the name used to represent the form, is also the title of the selection in the profile card. The form content can be nested <fieldset>, input box <input>, menu <select> and necessary hint text.
<input name= "Variable" title= "label" type= "type" value= "value" default= "" Default "format=" specifier "emptyok=" false |true "size=" n "maxlength=" n "tabindex=" n "/>, which is used to enter text, except that the Name property is necessary and optional.
- The Name property that specifies the variable names that are used to store the input text.
- The Title property, the name of the input box, can also be used as the option name in the Profile Card page.
- Type property, the default value is text, and if you select password, the input data appears as *.
- The Value property, which is equivalent to the following default property in syntax and behavior,
- The default property, which specifies that the input box defaults, the Name property specifies the default value for the variable, which is not valid when the user enters a new value, and if the value does not conform to the following format property, the phone also ignores the default value.
- The Format property, which is used to format the entered data, is available as follows, using the form of "one digit mark" and "* mark", which represents n-tagged characters, such as 3X, which represents any one (less than the value of the MaxLength property) as a marker character.
Tag description
A any symbol or capital letter (excluding numbers)
A any symbol or lowercase letter (excluding numbers)
N any number (excluding symbols or letters)
X any symbol, number, or capital letter (cannot be changed to lowercase letters)
x any symbol, number, or lowercase letter (cannot be changed to uppercase letters)
M any symbol, number, or uppercase letter (can be changed to lowercase letters) or more than one character, default to uppercase
m any symbol, number, or lowercase letter (can be changed to uppercase letters) or multiple characters, default to lowercase
- The MaxLength property specifies the maximum length of characters that a user can enter, with a maximum limit of 256 characters.
- Emptyok property, which indicates whether the user can fill out the entry box, default to False.
- Size property, the input box displays the length and is not currently supported.
- The TabIndex property, which is similar to the choice in which the focus falls after the TAB key is pressed in an HTML form, which determines the order in which the number is left behind. Not currently supported.
Test4.wml
<?xml version= "1.0"?>
<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "http://www.wapforum.org
/dtd/wml_1.1.xml ">
<wml>
<card id= "Card1" ordered= "false" >
<p>
Username:<input name= "USERNAME" title= "User name" type= "text" value= "Yournam
Ehere "format=" *m "emptyok=" false "Maxlength=" "tabindex=" 1 "/>
Password:<input name= "PASSWORD" title= "PASSWORD" type= "PASSWORD" format= "8x"
Emptyok= "false" Maxlength= "8" tabindex= "2"/>
Comments:<input name= "COMMENTS" title= "comment" "type=" text "value=" Yourcomme
Ntshere "format=" *m "emptyok=" true "maxlength=" "tabindex=" 3 "/>
</p>
</card>
</wml>
Try the odered value in the previous example <card> to "true" and then add the <fieldset title= "field1" > and </fieldset in <p> and </p> > Try it.
The <select> menu is similar to the <SELECT>,<select> and </select> rooms in an HTML form that can contain <optgroup> and <option> tags. The syntax is as follows, all attributes are optional:
<select title= "label" multiple= "False|true" name= "variable" default= "def
Ault "Iname=" Index_var "ivalue=" Default "tabindex=" N ">
<optgroup title= "label" > Menu content </optgroup>
<option title= "label" value= "value" onpick= "url" >
Event or text
</option>
</select>
- Title property, such as the title property of <input> above.
- Multiple property to specify whether a user can make multiple selections and the default value is False.
- The Name property, which stores the variable name of the user-selected item, the value of the <option> tag, and if the user does not have a choice and does not specify a default value with the Defaults property, the cell phone changes the amount to an empty string "", and for multiple selections, each value is ";" Separate.
- Default property, you can assign the variable to the Name property for the specified value.
- Iname property, which is used to record the location of the user-selected item, and the corresponding value starts at 1. If it is not selected, the value
- is 0.
- Ivalue property, which is used to record the location of the default value.
<optgroup> can be used to include multiple <option> groupings,<optgroup> and </optgroup> between <optgroup> and <option> The label is not currently supported.
<option>, similar to the <option> of an HTML selection, used to indicate the optional menu. <option> and </option> can include events (see next section) and menu display text. The <option> property is optional, where the Value property is used to provide the values, and when selected, assigns the value to the variable specified by the <select> 's Name property. Onpick property that specifies the URL of the page to open when the user chooses the item and presses the Accept key.
Test5.wml
<?xml version= "1.0"?>
<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "http://www.wapforum.org
/dtd/wml_1.1.xml ">
<wml>
<card id= "Card0" ordered= "false" >
<p>
Please select a city ...
<select title= "Cities List" Name= "City" >
<option title= "Beijing" value= "C1" >Beijing</option>
<option title= "Shanghai" value= "C2" >Shanghai</option>
<option title= "Hongkong" Value= "C3" >Hongkong</option>
</select>
Please select Columns ...
<select title= "Column List" multiple= "true" Name= "col" >
<option title= "Hot News" value= "L1" >News</option>
<option title= "Cool Sports" value= "L2" >Sports</option>
<option title= "Pop Enter,,," value= "L3" >Entertainment</option>
</select>
</p>
</card>
</wml>