Wireless Markup Language Reference

WML is evolving. The basic language is still quite simple, but compatibility and usage issues exist. This appendix provides an alphabetical list of all WML tags (including vendor-specific extensions to WML). For your convenience, a description, syntax, example, and usage notes accompany each tag.

Please note the following:

  • WML tags must always be specified in lowercase.

  • WML tags must have matching end tags or at least a closing /.

  • Test all code on as many devices and emulators as possible. WML support is still very inconsistent; therefore, there is no substitute for thorough testing.

<a>

Description: Creates an anchor (also called a link). Takes a required URL as an attribute. The text (or images) between the <a> and <a/> tags is selectable. Unlike <anchor>, <a> only supports <go> tasks (which are implicit). The complete set of attributes is listed in Table A.1. This tag is covered in detail in Chapter 4, "Card Navigation."

Syntax: <a accesskey="value" href="url" title="title">... </a>

Table A.1. <a> Attributes
Attribute Required Description
accesskey No A number (0 through 9) that is displayed to the left of the link. Users may press that keypad number to make a selection.
href Yes Destination URL.
title No Brief text identifying the link. It is recommended that, if used, this text be no longer than six characters.

Example: The following example displays the text Home, which links to the URL index.wml:

<a href="index.wml">Home</a>

Usage Notes:

  • It is recommended that this tag be used instead of <anchor>.

  • To link to a specific card in a deck, add that card ID to the URL in the form of #card.

  • The accesskey attribute is a Phone.com extension and is not part of the WML specification.

See Also: <anchor>

<access>

Description: Applies access-control rules to a deck effectively restricting referred access. <access> must be specified between <head> and </head> tags. The complete set of attributes is listed in Table A.2. This tag has no matching end tag.

Syntax: <access domain="domain" path="path" />

Table A.2. <access> Attributes
Attribute Required Description
domain No The domain suffix of allowed referring pages. Default is the current deck's domain.
path No The path prefix of allowed referring pages.

Example: The following example restricts access to referrers in the forta.com domain:

<head>
 <access domain="forta.com" />
</head>

Usage Notes:

  • <access> applies to an entire deck, and only one <access> tag per deck is allowed.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <head>

<anchor>

Description: Creates an anchor (also called a link) associated with <go>, <prev>, or <refresh> tasks. Unlike <a>, <anchor> does not take a URL as an attribute. <anchor> takes a single attribute as listed in Table A.3. This tag is covered in detail in Chapter 4.

Syntax: <anchor title="title">... </anchor>

Table A.3. <anchor> Attributes
Attribute Required Description
title No Brief text identifying the link. It is recommended that, if used, this text be no longer than six characters.

Example: The following example displays the text Home, which links to the URL index.wml:

<anchor>
 Home
 <go href="index.wml" />
</anchor>

Usage Notes:

  • It is recommended that the <a> tag be used instead of <anchor>.

See Also: <a> <go> <prev> <refresh> <setvar>

<b>

Description: Displays all text between <b> and </b> in bold text. This tag takes no attributes. This tag is covered in detail in Chapter 5, "Managing Output."

Syntax: <b> ... </b>

Example: The following example displays the word bold in bold:

<p>
Example of the use of <b>bold</b> text.
</p>

Usage Notes:

  • This tag is not supported by the Nokia 7110 browser.

  • Where possible use <strong> and <em> instead of <b>.

See Also: <big> <em> <i> <small> <strong> <u>

<big>

Description: Displays all text between <big> and </big> in a large font. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <big> ... </big>

Example: The following example displays the word big in big:

<p>
Example of the use of <b>big</b> text.
</p>

Usage Notes:

  • This tag is not currently supported by the Phone.com or Nokia 7110 browsers.

See Also: <b> <em> <i> <small> <strong> <u>

<br>

Description: Forces a line break. This tag takes no attributes, and has no matching end tag. This tag is covered in detail in Chapter 5.

Syntax: <br />

Example: The following example inserts two breaks mid-sentence:

<p>
Welcome<br />to the WAP version<br />of my Web site.
</p>

Usage Notes:

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <p>

<card>

Description: Defines and names a new card. There are one or more cards within a deck, and each card must be uniquely identified within its deck. The complete set of attributes is listed in Table A.4. This tag is covered in detail in Chapter 3, "Writing for WAP in WML."

Syntax: <card id="id" newcontext="true|false" onenterbackward="URL" onenterforward="URL" ontimer="URL" ordered="true|false" title="title">... </card>

Table A.4. <card> Attributes
Attribute Required Description
id No Card unique identifier. It is recommended that this ID be no longer than eight characters.
newcontext No Flag indicating that the browser context should be reinitialized when the card is loaded. Valid values are true and false. Default is false.
onenterbackward No URL to be loaded when card is accessed via a <prev> task.
onenterforward No URL to be loaded when card is accessed via a <go> task.
ontimer No URL to be loaded when timer expires.
ordered No Flag indicating whether or not the content is data that must be rigidly ordered. Valid values are true and false. Default is true.
titleattributes;title> No Brief text identifying the card. Can be used for bookmark text, pop-ups, or other uses.

Example: The following example creates a simple welcome card:

<card id="welcome">
<p>
Welcome to the WAP version of my Web site!
</p>
</card>

Usage Notes:

  • The Nokia 7110 displays the title at the top of every card. Other browsers, such as the Phone.com browser, do not.

  • Even though id is not required, best practices dictate specifying an id for every <card>.

See Also: <do> <timer> <wml>

<catch>

Description: Specifies an exception handler that can process thrown exceptions. The complete set of attributes is listed in Table A.5.

Syntax: <catch name="name" onthrow="value">... </catch>

Table A.5. <catch> Attributes
Attribute Required Description
name No Name of exception to catch. If not specified, will catch all exceptions.
onthrow No Event to occur when exception is thrown.

Example: The following example creates a catch block to catch exceptions; a sent value is also received:

<catch name="err#1" onthrow="/error.wml">
 <receive name="msg">
</catch>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

See Also: <receive> <reset> <throw>

<do>

Description: Mechanism used to allow user actions within a card. <do> can be specified at the card or deck level. If specified at the deck level (via a <template>) the <do> is processed as if it were explicitly embedded into each card. <do> tags can be inserted anywhere within a <card>. The complete set of attributes is listed in Table A.6. This tag is covered in detail in Chapter 4.

Syntax: <do label="label" name="name" optional="true|false" type="type">... </do>

Table A.6. <do> Attributes
Attribute Required Description
label No Brief text to be used as the display label. It is recommended that, if used, this text be no longer than six characters.
name No Element name allowing card-level binding to override deck-level binding.
optional No Flag indicating that this element is optional, allowing the browser the option of not displaying it. Valid values are true and false. Default value is false.
type Yes User-interface mechanism associated with this event. Valid values are accept (acceptance), delete (delete item or choice), help (request for help), options (request for options), prev (backward navigation), reset (resetting state), unknown (generic element equivalent to empty type), or vendor specific mechanisms (in the format of vnd.co-type where co identifies the vendor).

Example: The following example displays the first card in a deck with a prompt for navigation to a second card in the deck:

<card id="card1">
 <do type="accept" label="Card 2">
  <go href="#card2" />
 </do>
 <p>
 This is card 1.
 You may select <b>card 2</b> to go to that card.
 </p>
</card>

<card id="card2">
 <p>
 This is card 2.
 </p>
</card>

Usage Notes:

  • Even though label is not required, best practices dictate specifying a label for every <do>.

  • Card-level <do> tags override deck-level <do> tags with the same name.

  • Inactive or <noop> <do> tags are not displayed.

See Also: <card> <go> <noop> <prev> <refresh> <template>

<em>

Description: Displays all text between <em> and </em> formatted with emphasis. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <em> ... </em>

Example: The following example displays the word emphasis in emphasis format:

<p>
Example of the use of <em>emphasis</em> formatting.
</p>

Usage Notes:

  • This tag is not currently supported by the Phone.com and Nokia 7110 browsers.

See Also: <b> <big> <i> <small> <strong> <u>

<exit>

Description: Terminates current context, optionally returning values to the parent context. This tag takes no attributes.

Syntax: <exit> ... </exit>

Example: The following example terminates the current context and returns control to the parent context:

<exit>
 <send value="100" />
</exit>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

See Also: <send> <spawn>

<fieldset>

Description: Groups input fields together so that the browser can optimize the display appropriately. <fieldset> takes a single attribute as listed in Table A.7. This tag is covered in detail in Chapter 7, "Working with User Input."

Syntax: <fieldset title="title">... </fieldset>

Table A.7. <fieldset> Attributes
Attribute Required Description
title NoName for field set, should be unique within a card.

Example: The following example is the form-field portion of a form in a deck containing two sets of fields (two sets of <fieldset> tags) to ensure correct grouping:

<p>
 <fieldset title="name">
  First name:
  <input type="text" name="fname" />
  <br />
  Last name:
  <input type="text" name="lname" />
  <br />
 </fieldset>
 <fieldset title="address">
  Address:
  <input type="text" name="address" />
  <br />
  City:
  <input type="text" name="city" />
  <br />
  Country:
  <input type="text" name="country" />
  <br />
 </fieldset>
</p>

Usage Notes:

  • Some devices use the title for presentation purposes.

  • <fieldset> tags can be nested.

See Also: <input> <optgroup> <option> <select>

<go>

Description: Opens a specified URL using GET or POST methods. <go> can also take one or more fields to be submitted with the URL. Fields are set with the <postfield> tag. If no fields are specified then the <go /> format must be used instead of <go> ... </go>. The complete set of attributes is listed in Table A.8. This tag is covered in detail in Chapter 4.

Syntax: <go accept-charset="charset" href="URL" method="GET|POST" sendreferer="true|false">... </go>

or

<go accept-charset="charset" href="URL" method="GET|POST" sendreferer="true|false" />

Table A.8. <go> Attributes
Attribute Required Description
accept-charset No Specifies the character encodings that the application can handle in comma- or space-delimited list.
href Yes Destination URL.
method No HTTP submission method. Valid values are get and post. Default is get.
sendreferer No Flag specifying whether to include the deck URL in the request. Valid values are true and false. Default value is false.

Example: The following example calls a URL with the post method and passes two form fields to it:

<go href="/search/index.cfm" method="post">
 <postfield name="user" value="BenForta" />
 <postfield name="format" value="full" />
</go>

Usage Notes:

  • <go> has two forms of syntax; you must use <go /> if no content (<postfield> or <setvar>) tags are used.

See Also: <do> <noop> <postfield> <prev> <refresh> <setvar>

<head>

Description: Provides information for an entire deck. This tag takes no attributes.

Syntax: <head> ... </head>

Example: The following example restricts access to referrers in the forta.com domain:

<head>
 <access domain="forta.com" />
</head>

Usage Notes:

  • <head> must always contain at least one of <access> or <meta>; empty <head> tags are not allowed.

  • If used, <head> must appear before any <card> tags.

See Also: <access> <link> <meta> <wml>

<i>

Description: Displays all text between <i> and </i> in italic text. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <i> ... </i>

Example: The following example displays the word italic in italic:

<p>
Example of the use of <i>italic</i> text.
</p>

Usage Notes:

  • This tag is not supported by the Nokia 7110 browser.

  • Where possible use <strong> and <em> instead of <i>.

See Also: <b> <big> <em> <small> <strong> <u>

<img>

Description: Displays an image in the browser. Local (internal) icons can also be displayed if available. The complete set of attributes is listed in Table A.9. This tag has no matching end tag. This tag is covered in detail in Chapter 6, "Using Images."

Syntax: <img align="bottom|middle|top" alt="text" height="value" hspace="value" localsrc="name|id" src="path" space="value" width="value" />

Table A.9. <img> Attributes
Attribute Required Description
align No Vertical image alignment. Valid values are bottom, middle, and top. Default is bottom.
alt Yes Alternative text to display if device cannot display image. Attribute must be specified but can be left blank.
height No Height of the image. Can be specified as a percentage value in which case size is based on available vertical space.
hspace No Amount of space to be left on either side of the image. Can be specified as a percentage value in which case size is based on available horizontal space.
localsrc No Name (or id) of internal icon to be used as the image.
src Yes Image source. Attribute must be specified but can be left blank.
vspace No Amount of space to be left above and beneath the image. Can be specified as a percentage value in which case size is based on available vertical space.
width No Width of the image. Can be specified as a percentage value in which case size is based on available horizontal space.

Example: The following example displays an image using a local icon if it is available; if not a regular BMP is displayed:

<img src="mailbox.bmp" localsrc=""mailbox alt="" />

Usage Notes:

  • Image horizontal alignment is managed via the <p> tag.

  • Not all devices can display images. localsrc can be used to refer to local icons, see Appendix F, "Local Icons," for a list of Phone.com localsrc icons.

  • If localsrc is used, alt and src should be specified as well (to ensure compatibility with devices that do not support localsrc).

  • The Phone.com browser does not support the height, vspace, and width attributes.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <p>

<input>

Description: Prompts for user input which will be saved to a variable. The complete set of attributes is listed in Table A.10. <input> supports the use of format masks to format and restrict user input, Table A.11 lists the supported mask characters. This tag has no matching end tag. This tag is covered in detail in Chapter 7.

Syntax: <input accesskey="value" emptyok="true|false" format="mask" maxlength="value" name="name" size="value" tabindex="value" title="title" type="password|text" value="value" />

Table A.10. <input> Attributes
Attribute Required Description
accesskey No A number (0 through 9) that is displayed to the left of the link. Users can press that keypad number to make a selection.
emptyok No Flag specifying whether this field can be left blank. Valid values are true and false. Default is false.
format No Format mask. See Table A.11. Mask characters can be preceded by a number (specifying the number of characters to allow) or by a * (specifying an unlimited number of characters). Default is *M.
maxlength No Maximum field length. Default is unlimited.
name Yes Name of variable to contain field value. If variable already contains a value it will be displayed in the field.
size No Width of input field in characters.
tabindex No Tabbing position within a card.
title No Brief field title which can be used by the browser for display.
type No Field type. Valid values are text and password (the latter is not echoed to the device). Default is text.
value No Initial value, only used if variable specified in name has no value.

Table A.11. <input> Format Masks
Mask Description
A Any symbol or uppercase character, but no numbers.
a Any symbol or lowercase character, but no numbers.
M Any symbol, number, or uppercase character (changeable to lowercase). For multiple character input, the first character is uppercase and additional characters are lowercase.
m Any symbol, number, or lowercase character (changeable to uppercase).
N Any numeric character.
X Any symbol, number, or uppercase character (not changeable to lowercase).
x Any symbol, number, or lowercase character (not changeable to uppercase).

Example: The following example is part of a form that prompts for a user's name and ID number (which is restricted to five digits):

<p>
 Name: <input type="text" name="user" />
 ID: <input type="text" name="id" format="NNNNN" />
</p>

Usage Notes:

  • Most developers avoid the use of the password type as data entry on phones tends to be tricky, and not seeing what is typed often results in incorrect data being submitted.

  • The accesskey attribute is a Phone.com extension and is not part of the WML specification.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <fieldset> <optgroup> <option> <select>

<link>

Description: Specifies relationships between this deck and other documents. The complete set of attributes is listed in Table A.12. This tag has no matching end tag.

Syntax: <link href="URL" rel="value" sendreferer="false|true" />

Table A.12. <link> Attributes
Attribute Required Description
href Yes URL of document being linked.
rel Yes Relationship.
sendreferer No Flag specifying whether to include the deck URL in the request. Valid values are true and false. Default value is false.

Example: The following example defines a simple relationships:

<head>
 <link href="/next/index.wml" rel="next" />
</head>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

  • If used, <link> must be specified within the <head> block.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <access> <head> <meta>

<meta>

Description: Specifies deck-specific meta information within a <head> block. The complete set of attributes is listed in Table A.13. This tag has no matching end tag.

Syntax: <meta content="content" forua="true|false" http-equiv="name" name="name" scheme="value" />

Table A.13. <meta> Attributes
Attribute Required Description
content No Property value.
forua No Flag specifying whether or not content is intended for the browser. Valid values are true and false. Default is true.
http-equiv No Property name specified as an HTTP header.
name No Property name.
scheme No Form or structure used to interpret the property value.

Example: The following example uses the <meta> tag to set the cache duration:

<head>
 <meta http-equiv="Cache-Control" content="max-age=1" forua="true" />
</head>

Usage Notes:

  • Not all devices support every meta information type.

  • The Phone.com browser does not support the scheme attribute.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <access> <head> <wml>

<noop>

Description: Does nothing (as in no operation). This tag is used to shadow deck level tasks (provided via a <template> tag). This tag takes no attributes and has no matching end tag.

Syntax: <noop />

Example: The following example specified no action for the accept button, overriding whatever action might have been specified at the deck level:

<do type="accept">
 <noop />
</do>

Usage Notes:

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <do> <go> <template>

<onevent>

Description: Specifies an action to be performed when specific events occur. Can be specified at the card level or at the deck level (via a <template> tag). <anchor> takes a single attribute as listed in Table A.14. This tag is covered in detail in Chapter 10, "Using Timers."

Syntax: <onevent type="type">... </onevent>

Table A.14. <onevent> Attributes
Attribute Required Description
type Yes Event type. Valid values are onenterbackward, onenterforward, onpick, and ontimer.

Example: This example displays a welcome message as long as the card was not accessed by navigating backward (using the Back button), in which case the user is redirected to another URL:

<card>
 <onevent type="onenterbackward">
  <go href="/index.wml" />
 </onevent>
 <p>
  Thanks for dropping by!
 </p>
</card>

Usage Notes:

  • Card-level <onevent> tags override deck-level <onevent> tags with the same type.

See Also: <do> <go> <template>

<optgroup>

Description: Groups options together so that the browser can optimize the display appropriately. <optgroup> takes a single attribute as listed in Table A.15. This tag is covered in detail in Chapter 7.

Syntax: <opgroup title="title">... </optgroup>

Table A.15. <optgroup> Attributes
Attribute Required Description
title No Name for group; should be unique within a card.

Example: The following example displays two groups of options (two sets of <optgroup> tags) to ensure correct grouping:

<p>
 Select a color:
 <select name="color">
  <optgroup title="color1">
   <option value="red">Red</option>
   <option value="orange">Orange</option>
   <option value="yellow">Yellow</option>
  </optgroup>
  <optgroup title="color2">
   <option value="green">Green</option>
   <option value="blue">Blue</option>
   <option value="violet">Violet</option>
  </optgroup>
 </select>
</p>

Usage Notes:

  • Some devices use the title for presentation purposes.

  • <optgroup> tags can be nested.

See Also: <fieldset> <input> <option> <select>

<option>

Description: Creates options within a <select> list. The complete set of attributes is listed in Table A.16. This tag is covered in detail in Chapter 7.

Syntax: <option onpick="URL" title="title" value="value">... </option>

Table A.16. <option> Attributes
Attribute Required Description
onpick No URL to navigate to upon option selection.
title No Optional title.
value No Value to be returned if option is selected.

Example: The following example presents several options in a <select> list; the selected value will be returned in the variable specified in the <select> tag's name attribute:

<select name="size">
 <option value="s">Small</option>
 <option value="m">Medium</option>
 <option value="l">Large</option>
 <option value="x">Extra Large</option>
</select>

Usage Notes:

  • Some devices use the title for presentation purposes.

  • Unlike in HTML, default selections cannot be specified in the <option> tag, instead they must be specified in the <select> tag.

See Also: <fieldset> <input> <optgroup> <select>

<p>

Description: Creates a paragraph, establishing alignment and wrapping for all text within it. The complete set of attributes is listed in Table A.17. This tag is covered in detail in Chapter 5.

Syntax: <p align="center|left|right" mode="nowrap|wrap">... </p>

Table A.17. <p> Attributes
Attribute Required Description
align No Paragraph alignment. Valid values are center, left, and right. Default is left.
mode No Text-wrapping mode. Valid values are nowrap and wrap. Default for the first card in a deck is wrap.

Example:

<wml>
 <p align="left">
  This text is left justified.
 </p>
 <p align="center">
  This text is centered.
 </p>
 <p align="right">
  This text is right justified.
 </p>
</wml>

Usage Notes:

  • The default mode for the first card in a deck is wrap. The default mode for subsequent cards is the mode of the card directly preceding it.

  • Unlike in HTML, the WML <p> tag must always have a matching </p> tag.

  • Alignment affects images in between the <p> and </p> tags. However, some browsers (like the Nokia 7110) always display images left aligned regardless of <p> alignment.

  • The Nokia 7110 browser does not support the nowrap mode and displays all text wrapped.

  • Devices can break lines between any words. To prevent a break use the non-breaking space entity &nbsp;.

See Also: <br>

<postfield>

Description: Specifies a field and value to be sent to a URL (via the <go> tag). The complete set of attributes is listed in Table A.18. This tag has no matching end tag.

Syntax: <postfield name="name" value="value" />

Table A.18. <postfield> Attributes
Attribute Required Description
name Yes Field name.
value Yes Field value.

Example: The following example calls a URL with the post method and passes two form fields to it using <postfield> tags:

<go href="/search/index.cfm" method="post">
 <postfield name="user" value="BenForta" />
 <postfield name="format" value="full" />
</go>

Usage Notes:

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <go> <setvar>

<prev>

Description: Returns to the previous card. If there is no previous card, the <prev> call will do nothing (and will not generate an error). If no content is specified then the <prev /> format must be used instead of <prev> ... </prev>. This tag takes no attributes. This tag is covered in detail in Chapter 4.

Syntax: <prev> ... </prev>

or

<prev />

Example: This example remaps and relabels the accept key so that it behaves like a back key:

<do type="accept" label="Previous">
 <prev />
</do>

Usage Notes:

  • <prev> has two forms of syntax; you must use <prev /> if no content is specified.

See Also: <do> <go> <refresh> <setvar>

<receive>

Description: Receives sent values when an exception is throw. Receive takes a single attribute as listed in Table A.19. This tag has no matching end tag.

Syntax: <receive name="value" />

Table A.19. <receive> Attributes
Attribute Required Description
name YesVariable name.

Example: The following example creates a catch block to catch exceptions, a sent value is also received:

<catch name="err#1" onthrow="/error.wml">
 <receive name="msg">
</catch>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <catch> <send> <throw>

<refresh>

Description: Refreshes (or resets) variables to initial or updated values. This tag takes no attributes.

Syntax: <refresh> ... </refresh>

Example: This example displays a Reset button, which, when pressed, resets two variables to initial empty values:

<do type="options" label="Reset">
 <refresh>
  <setvar name="fname" value="" />
  <setvar name="lname" value="" />
 </refresh>
</do>

Usage Notes:

  • At least one variable must be set (using <setvar>) when using this tag.

See Also: <do> <go> <prev> <setvar>

<reset>

Description: Clears all variables in the current context. This tag takes no attributes and has no matching end tag.

Syntax: <reset />

Example: This example clears all variables when a <go> is executed:

<go href="/home">
 <reset />
</go>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <catch> <receive> <throw>

<select>

Description: Displays a list of options for user selection. Options are added using the <option> tag, and can be grouped hierarchically using the <optgroup> tag. The complete set of attributes is listed in Table A.20. This tag is covered in detail in Chapter 7.

Syntax: <select iname="value" ivalue="value" multiple="false|true" name="name" tabindex="value" title="title" value="value">... </select>

Table A.20. <select> Attributes
Attribute Required Description
iname No Index number of default option (base 1).
ivalue No Default value.
multiple No Flag specifying whether or not multiple selections can be made. Valid values are true and false. Default is false.
name Yes Name of variable to contain value of selected <option>.
tabindex No Tabbing position within a card.
title No Field value.
value No Default value for name variable.

Example: The following example presents several options in a <select> list, the selected value will be returned in the variable specified in the <select> tag's name attribute:

<select name="size">
 <option value="s">Small</option>
 <option value="m">Medium</option>
 <option value="l">Large</option>
 <option value="x">Extra Large</option>
</select>

Usage Notes:

  • Some devices use title for presentation purposes.

  • Some browsers display all <select> options, whereas others display just the selected <option> requiring scrolling to change it.

  • Use ivalue="0" to prevent the browser from selecting a default option.

  • The tabindex attribute is not supported by the Phone.com browser.

See Also: <fieldset> <input> <optgroup> <option>

<send>

Description: Sends a value to be included in a parameter block. The complete set of attributes is listed in Table A.21. This tag has no matching end tag.

Syntax: <send value="value" />

Table A.21. <send> Attributes
Attribute Required Description
value Yes Value to send.

Example: The following example terminates the current context and returns control to the parent context:

<exit>
 <send value="100" />
</exit>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <exit> <receive> <throw>

<setvar>

Description: Sets a variable to a specified value. The complete set of attributes is listed in Table A.22. This tag has no matching end tag.

Syntax: <setvar name="name" value="value" />

Table A.22. <setvar> Attributes
Attribute Required Description
name Yes Field name.
value Yes Field value.

Example: This example displays a Reset button, which, when pressed, resets two variables to initial empty values:

<do type="options" label="Reset">
 <refresh>
  <setvar name="fname" value="" />
  <setvar name="lname" value="" />
 </refresh>
</do>

Usage Notes:

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <go> <postfield> <prev> <refresh>

<small>

Description: Displays all text between <small> and </small> in a small font. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <small> ... </small>

Example: The following example displays the word small in small:

<p>
Example of the use of <small>small</small> text.
</p>

Usage Notes:

  • This tag is not currently supported by the Phone.com browser.

See Also: <b> <big> <em> <i> <strong> <u>

<spawn>

Description: Creates a new browser context, loading a specified URL into that new context. The complete set of attributes is listed in Table A.23.

Syntax: <spawn accept-charset="charset" href="URL" method="GET|POST" enexit="value" sendreferer="true|false">... </spawn>

Table A.23. <spawn> Attributes
Attribute Required Description
accept-charset No Specifies the character encodings that the application can handle in comma- or space-delimited list.
href Yes Destination URL.
method No HTTP submission method. Valid values are get and post. Default is get.
onexit No The event that occurs when a child context is exited.
sendreferer No Flag specifying whether or not to include the deck URL in the request. Valid values are true and false. Default value is false.

Example: This example creates a new browser context and initializes two variables within it:

<spawn href="/child" onexit="/continue">
 <setvar name="fname" value="Ben" />
 <setvar name="lname" value="Forta" />
</spawn>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

See Also: <catch> <exit> <onevent> <receive> <setvar>

<strong>

Description: Displays all text between <strong> and </strong> formatted with strong emphasis. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <strong> ... </strong>

Example: The following example displays the word strong in strong emphasis:

<p>
Example of the use of <strong>strong</strong> format.
</p>

Usage Notes:

  • This tag is not currently supported by the Phone.com and Nokia 7110 browsers.

See Also: <b> <big> <em> <i> <small> <u>

<table>

Description: Creates a columnar table providing control over table alignment. The complete set of attributes is listed in Table A.24. This tag is covered in detail in Chapter 5.

Syntax: <table align="c|l|r" columns="value" title="title">... </table>

Table A.24. <table> Attributes
Attribute Required Description
align No Table alignment. Valid values are c (for center), l (for left), r (for right). Default is l.
columns Yes Number of columns in table.
title No Table title.

Example: The following example creates a simple table with two rows and two cells in each:

<table columns="2">
 <tr>
  <td>Name:</td>
  <td>Ben Forta</td>
 </tr>
<tr>
  <td>E-Mail:</td>
  <td>[email protected]</td>
 </tr>
</table>

Usage Notes:

  • Tables are automatically created as narrow as possible.

  • If the actual number of columns is greater than specified in the columns attribute, the last cells will be merged.

See Also: <td> <tr>

<td>

Description: Creates cells within table rows. This tag takes no attributes and must be specified in between <tr> and </tr> tags. This tag is covered in detail in Chapter 5.

Syntax: <td> ... </td>

Example: The following example creates a simple table with two rows and two cells in each:

<table columns="2">
 <tr>
  <td>Name:</td>
  <td>Ben Forta</td>
 </tr>
<tr>
  <td>E-Mail:</td>
  <td>[email protected]</td>
 </tr>
</table>

Usage Notes:

  • Do not add more cells in a row than specified in the <table> columns attribute, or cells will be merged automatically.

  • Table cells may be empty.

  • Table cells may contain text or images.

See Also: <table> <tr>

<template>

Description: Specifies a template containing settings that will be used deck wide. The complete set of attributes is listed in Table A.25.

Syntax: <template> ... </template>

Table A.25. <template> Attributes
Attribute Required Description
onenterbackward No URL to be loaded when card is accessed via a <prev> task.
onenterforward No URL to be loaded when card is accessed via a <go> task.
ontimer NoURL to be loaded when timer expires.

Example: The following template assigns and labels the previous button for all cards in the deck and assigns a deck-wide ontimer event:

<template ontimer="/logout.wml">
 <do type="prev" label="Previous">
  <prev />
 </do>
</template>

Usage Notes:

  • Options specified at the card-level override options specified at the deck level (via the <template> tag).

See Also: <do> <onevent> <timer>

<throw>

Description: Throws an exception to be caught by a <catch> tag. Receive takes a single attribute as listed in Table A.26.

Syntax: <throw name="name">... </throw>

Table A.26. <throw> Attributes
Attribute Required Description
name Yes Name of the exception to be thrown.

Example: The following example throws an exception in response to a logon failure:

<throw name="logon failure">
 <send value="Invalid login name or password" />
</throw>

Usage Notes:

  • This tag is only supported by Phone.com browsers and is not part of the official WML specification.

See Also: <catch> <receive> <reset>

<timer>

Description: Invokes a timer after a specified amount of inactivity. The complete set of attributes is listed in Table A.27. This tag has no matching end tag. This tag is covered in detail in Chapter 10.

Syntax: <timer name="name" value="value" />

Table A.27. <timer> Attributes
Attribute Required Description
name No Variable to contain timer value on exit.
value Yes Timeout value.

Example: This example displays a card for five seconds and then displays a second card:

<card id="card1" ontimer="#card2">
 <timer value="50" />
<p>
 Waiting 5 seconds ...
 </p>
</card>
<card id="card2">
 <p>
 Thank you for waiting!
 </p>
</card>

Usage Notes:

  • Only one timer is allowed per card.

  • Timers support time intervals in 1/10 (.1) seconds.

  • A timeout value of 0 disables the timer.

  • As this tag has no matching end tag, care must be taken to always include the trailing / character.

See Also: <card> <template>

<tr>

Description: Creates rows within a table. This tag takes no attributes and must be specified in between <table> and </table> tags. This tag is covered in detail in Chapter 5.

Syntax: <tr> ... </tr>

Example: The following example creates a simple table with two rows and two cells in each:

<table columns="2">
 <tr>
  <td>Name:</td>
  <td>Ben Forta</td>
 </tr>
<tr>
  <td>E-Mail:</td>
  <td>[email protected]</td>
 </tr>
</table>

Usage Notes:

  • Table rows can be empty.

See Also: <table> <td>

<u>

Description: Displays all text between <u> and </u> as underlined text. This tag takes no attributes. This tag is covered in detail in Chapter 5.

Syntax: <u> ... </u>

Example: The following example displays the word underlined in underlined:

<p>
Example of the use of <u>underlined</u> text.
</p>

Usage Notes:

  • Where possible use <strong> and <em> instead of <u>.

  • This tag is not currently supported by the Phone.com and Nokia 7110 browsers.

See Also: <b> <big> <em> <i> <small> <strong>

<wml>

Description: Creates a WML deck consisting of one or more cards. This tag takes no attributes. This tag is covered in detail in Chapter 3.

Syntax: <wml> ... </wml>

Example: The following example creates a simple two-card deck:

<wml>
 <card id="card1">
 <p>This is card 1</p>
 </card>
 <card id="card2">
 <p>This is card 2</p>
 </card>
</wml>

Usage Notes:

  • This tag is required; every valid WML page must include this tag.

See Also: <card> <head> <template>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.89.85