Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









WML TAG:  setvar

<setvar name=... value=... />
 
The setvar tag is used to assign a value to a named variable. The assignment is done using a name/value pair where the name is set by the name attribute and the value by the value attribute. The name of the variable in the name/value pair must be of correct syntax.
 
The setvar tag can only be nested in the go, prev, and refresh tags. It can be used more than once.
 
This is a self-closing tag.
 
Nested Tags:  None
 
Attributes
 
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
 
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
 
name
The mandatory name attribute is part of the name/value pair. It is a string that is the name of the variable that will be assigned the value set by the value attribute.
 
value
The mandatory value attribute is part of the name/value pair. It is a string that is the value of the variable named in the name attribute.
 
In this example, card6 sets the values for two variables and navigates to card7, where both values are displayed.
 
Code:
<?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="card6">
<p>
Please click accept:
<do type="accept">
   <go href="#card7">
      <setvar name="NameVar" value="DevGuru" />
      <setvar name="NumVar" value="348" />
   </go>
</do>
</p>
</card>

<card id="card7">
<p>
NameVar = $NameVar
<br />
NumVar = $NumVar
</p>
</card>

</wml>


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information