This is a discussion on Learn WAP within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Specify a Variable with the Setvar Command When someone executes a task (like go, prev, and refresh), the setvar element ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Specify a Variable with the Setvar Command When someone executes a task (like go, prev, and refresh), the setvar element can be used to set a variable with a specified value. The following example will create a variable named i with a value of 500: <setvar name="i" value="500"/> The name and value attributes are required. |
| Sponsored Links |
| |||
| Specify a Variable through an Input Element Variables can also be set through an input element (like input, select, option, etc.). The following example will create a variable named schoolname: <card id="card1"> <select name="schoolname"> <option value="HTML">HTML Tutorial</option> <option value="XML">XML Tutorial</option> </select> </card> |
| |||
| To use the variable we created in the example above: <card id="card2"> <p>You selected: $(schoolname)</p> </card> |
| |||
| A WML deck with two cards - one for user input and one for displaying the result - can be set up, as demonstrated in this example: <?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" title="Tutorial"> <do type="accept" label="Answer"> <go href="#card2"/> </do> <p> <select name="name"> <option value="HTML">HTML Tutorial</option> <option value="XML">XML Tutorial</option> <option value="WAP">WAP Tutorial</option> </select> </p> </card> <card id="card2" title="Answer"> <p> You selected: $(name) </p> </card> </wml> |
| |||
| The first card might look like this in your mobile phone display: ----- Tutorial ---------- HTML Tutorial XML Tutorial WAP Tutorial Answer |
| |||
| Example Explained The Prolog <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> The first lines in the WML document are called the prolog. The prolog defines that this is an XML document, it then defines the XML version, and the DTD to be referenced. |
| |||
| The Cards <card> ..... </card> Cards are always displayed one at the time. This WML deck contains two cards - one for user input and one for displaying the result. |
| |||
| The <do> element <do> ... </do> The first card has a <do> element that defines an event to be triggered. The type="accept" attribute of the <do> element causes the label="Answer" to be displayed in the lower left corner of the display. |
| |||
| The Event The <go> element triggers when the user clicks the <do> label. The href="#card2" attribute of the <go> element causes card2 to be displayed on the screen. |
| |||
| Hello, Thanks to share the information about WAP and WML,this language is used for the wireless device or hand held device,can you give some information about how to create a link deck and cards. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to learn c++ | bikky | C and C++ Programming | 8 | 09-26-2008 04:36 AM |
| Learn How To Access Your PC From Anywhere | vadivelanvaidyanathan | Computer Hardware | 0 | 09-06-2007 10:03 PM |
| Best Book to learn VC++ | prasannavigneshr | C and C++ Programming | 9 | 08-07-2007 01:10 AM |
| What is the best way to learn PHP | hazephase | PHP Programming | 1 | 07-15-2007 06:15 PM |
| Want To Learn C++ | Learn Now Cheap! | theseokit | C and C++ Programming | 2 | 02-16-2007 08:04 AM |