Table 3.13Attribute for the element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the element: This is
Trang 1The <i> Element
The <i> element signifies that the text contained within should be rendered by the user-agent in an italic font However, <em> is the recommended use to sig-nify emphasis.Table 3.13 lists the attribute for the <i> element
Table 3.13Attribute for the <i> element
Attribute Name Description
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <i> element:
This is normal text but <i>this is italic text</i>.
The <img> Element
The <img> element allows a wireless bitmap (WBMP) image to be included See Table 3.14 for a list of attributes for the <img> element
Table 3.14Attributes for the <img> Element
Attribute Name Description
align Specifies how the image should be aligned with
refer-ence to the text flow it appears within Possible options are one of top, middle, or bottom.
alt Alternate text that can be displayed when the image is
unavailable.
height The height of the image in pixels.
hspace The amount of padding that should be applied to the
image horizontally.
localsrc An image, contained internally within the device, that
can be displayed as an alternative.
src The URI where the image to be displayed resides.
vspace The amount of padding that should be applied to the
image vertically.
width The width of the image in pixels.
xml:lang The natural or formal language of the element.
Trang 2The following is an example of the syntax for the <img> element:
<img src="logo.wbmp" alt="Company Logo" height="30" width="60"/>
The <input> Element
The <input> element allows data to be entered by the user; it features some
useful methods of constraining the input via the format attribute, which can mask
the content to ensure that only the input you want is sent to the server See Table 3.15 for a list of attributes for the <input> element
Table 3.15Attributes for the <input> Element
Attribute Name Description
emptyok This is either true or false, and if set to true, the element
will allow the input value to be empty.
format The format attribute allows conditions to be set that
must be met before the data entry will be accepted All other entries will be ignored These options are available:
A Only uppercase, non-numeric characters
a Only lowercase, non-numeric characters
N Only numeric characters
X Any uppercase character
x Any lowercase character
M Any character (the default value)
m Any character but assumed to be lowercase
*f Appearing at the end of the format string, this allows any number of characters and must be pre-ceded by one of the above characters
nf A number of characters (n) may be entered where
f is one of the above formatting characters (other
than *f)
\c Displays the next character (c) in the text field
Useful for formatting phone numbers and so on
maxlength The maximum number of characters that can be entered
into the input field by the user.
name The name of the variable that will be set for the input
element.
size The width of the input field in characters.
tabindex The position in tabbing order.
Trang 3type This can be either text or password When password is
specified as the attribute, input is masked This helps to keep private data private from casual onlookers.
value A default value for the input element.
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <input> element:
<input name="Name" type="text" value="Richard"/>
<card>
<p>
Name: <input name="Name" type="text" value="Richard"/><br/>
Favorite Ice-cream: <input name="Ice-cream" type="text">
</p>
</card>
NOTE
The name attribute is required at all times and the emptyok attribute defaults to false if not set to true Do not rely on the size attribute to aid
layout because not all devices support this.
The <meta> Element
The <meta> element provides meta information in the head of a WML deck
as a name and value pair.The <meta> element cannot appear anywhere in the deck other than in the head See Table 3.16 for a list of attributes for the <meta> element
Table 3.15Continued
Attribute Name Description
Trang 4Table 3.16Attributes for the <meta> Element
Attribute Name Description
content The value of the property.
forua This is either true or false, and if false, the meta
infor-mation must be removed before the content is sent to the user Conversely, if true, the header information must be sent to the user.
http-equiv This allows an HTTP header to be set as per RFC2068.
name The name of the property.
scheme A structure or form that can be used to interpret the
property value.
The following is an example of the syntax for the <meta> element:
<head>
<meta content="charset" value="character-set=ISO-10646-UCS-2"/>
</head>
The <noop> Element
The <noop> element specifies that no operation should be carried out by the user-agent.Table 3.17 lists the attribute for the <noop> element
Table 3.17Attribute for the <noop> Element
Attribute Name Description
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <noop> element:
<noop>Nothing to be done here</noop>
The <onevent> Element
The <onevent> element binds an event to an enclosed task.Table 3.18 lists the attribute for the <onevent> element
Trang 5Table 3.18Attribute for the <onevent> Element
Attribute Name Description
type The intended use of the element This attribute is
required.
The following is an example of the syntax for the <onevent> element:
<onevent type="onenterbackward">
<go href="deck.wml"/>
</onevent>
The <optgroup> Element
The <optgroup> element allows the grouping of options hierarchically to pro-vide an indication to the user-agent of how the content should be grouped and rendered See Table 3.19 for a list of attributes for the <optgroup> element
Table 3.19Attributes for the <optgroup> Element
Attribute Name Description
title A short text string that is used to identify the group
and which may be displayed.
xml:lang The natural or formal language of the element.
The following is an example of the syntax for the <optgroup> element:
<optgroup title="Ice-Creams">
<option value="Strawberry"/>
<option value="Vanilla"/>
<option value="Chocolate"/>
</optgroup>
The <option> Element
The <option> element defines an option in a list and occurs within a <select> element See Table 3.20 for a list of attributes for the <option> element
Trang 6Table 3.20Attributes for the <option> Element
Attribute Name Description
onpick The URI to navigate to upon selection by the user
title A short text string that is used to identify the option
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <option> element:
<option title="Strawberry" value="Strawberry"/>
NOTE
See the <select> element for further examples of option lists.
The <p> Element
Text that appears within the <p> element is designated as a paragraph See Table 3.21 for a list of attributes for the <p> element
Table 3.21Attributes for the <p> Element
Attribute Name Description
align This can be either left (the default), right, or center—
though support for this is varied.
mode This can be either wrap or nowrap and specifies
whether the text within the paragraph should wrap where it is too long to fit on the display screen.
The following is an example of the syntax for the <p> element:
<p>
This is a paragraph of text that will wrap on reaching the edge of the screen and is left aligned by default.
Trang 7The <postfield> Element
The <postfield> element specifies a name and value pair that will be sent to the server as part of a URL request.You can use the <postfield> element with the
<go> element (described previously) to provide a variety of options for transmit-ting the information See Table 3.22 for a list of attributes for the <postfield> element
Table 3.22Attributes for the <postfield> Element
Attribute Name Description
The following is an example of the syntax for the <postfield> element:
<postfield name="Ice-cream" value="Chocolate"/>
The <prev> Element
The task element <prev> specifies that navigation should take the user one step back in the history stack.The following is an example of the syntax for the
<prev> element:
<anchor>
<prev/>Back
</anchor>
The <refresh> Element
The <refresh> element specifies a contextual task to be performed by the user-agent See the <setvar> element for more information on using <refresh>
The <select> Element
The <select> element allows the user to make a selection from a list of options (see the <option> element described earlier).Table 3.23 lists the attributes for the
<select> element
Trang 8Table 3.23Attributes for the <select> Element
Attribute Name Description
Iname The name of the variable that will be set with the
option value.
ivalue The default selection value.
multiple This is either true or false and signifies whether multiple
options may be selected The default is false.
name The name of the variable to be set.
tabindex This is used to set the tabbing position of the current
element.
title The title of the selection list that may be used to aid
identification of the purpose of the list.
value The value that will be applied to a variable when the
option is selected.
xml:lang The natural or formal language of the element.
The following is an example of the syntax for the <select> element:
<select name="Ice-cream" value="Chocolate" title="Ice-cream:">
<option value="Strawberry">Strawberry</option>
<option value="Vanilla">Vanilla</option>
<option value="Chocolate">Chocolate</option>
</select>
The <setvar> Element
The <setvar> element is used to set a variable within the user-agent after a task
is executed See Table 3.24 for a list of attributes for the <setvar> element
Table 3.24Attributes for the <setvar> Element
Attribute Name Description
The following is an example of the syntax for the <setvar> element:
Trang 9The <small> Element
The <small> element indicates that the user-agent should render the text in a smaller font size than the base font size for the device.Table 3.25 lists the
attribute for the <small> element
Table 3.25Attribute for the <small> Element
Attribute Name Description
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <small> element:
This text is a normal size <small>but this text is smaller!</small>
The <strong> Element
The <strong> element indicates that the contained text should be rendered with strong emphasis.Table 3.26 lists the attribute for the <strong> element
Table 3.26Attribute for the <strong> Element
Attribute Name Description
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <strong> element:
This text is normal but <strong>this text is strongly
emphasized</strong>.
The <table> Element
The <table> element, along with the <tr> and <td> elements, is used to create columns and rows of text and/or images within a card See Table 3.27 for a list of attributes for the <table> element
Trang 10Table 3.27Attributes for the <table> Element
Attribute Name Description
align Specifies how the content should be laid out; Allowable
values are L (left), C (center), and R (right).
columns The number of columns for the row set.
title The title of the selection list that may be used to aid
identification of the purpose of the list.
The following is an example of the syntax for the <table> element:
<table align="left" columns="1" title="Ice-creams">
</table>
The <tr> Element
The <tr> element signifies a table row.The following is an example of the syntax for the <tr> element:
<table align="left" columns="1" title="Ice-creams">
<tr>
</tr>
</table>
The <td> Element
The <td> element signifies a cell that contains the text or image.Table 3.28 lists the attribute for the <td> element
Table 3.28Attribute for the <td> Element
Attribute Name Description
xml:lang The natural or formal language of the element
The following is an example of the syntax for the <td> element: