
- WML Tutorial
- WML - Home
- WML - Overview
- WML - Environment
- WML - Syntax
- WML - Elements
- WML - Comments
- WML - Variables
- WML - Formatting
- WML - Fonts
- WML - Images
- WML - Tables
- WML - Links
- WML - Tasks
- WML - Inputs
- WML - Submit Data
- WML - Server Scripts
- WML - Events
- WML - Timer
- WML - Template
- WML - DTD
- WML2 - Tutorial
- WML References
- WML - Entities
- WML - Tags Reference
- WML Tools
- WAP - Emulators
- WML - Validator
- WML Useful Resources
- WML - Quick Guide
- WML - Useful Resources
- WML - Discussion
WML <setvar> Tag
The <setvar> element is used as a result of the user executing some task. The >setvar> element can be used to set a variable's state within the following elements: <go>, <prev>, and <refresh>.
Attributes:
This element supports the following attributes:
Attribute | Value | Description |
---|---|---|
name | string | Sets the name of the variable |
value | string | Sets the value of the variable |
class | class data | Sets a class name for the element. |
id | element ID | A unique ID for the element. |
Example:
The following element would create a variable named a with a value of 1000:
<setvar name="a" value="1000"/>
Following is another example showing usage of this element.
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"> <wml> <card> <p> <anchor> Go to next chapter <go href="#chapter2"> <setvar name="x" value="30"/> </go> </anchor> </p> </card> </wml>
Advertisements