Won Contests Let Us Talk Mail Me Light of Knowledge


W ML - Wireless Markup Language
  
 Building Mobile Applications using WAP & Wireless Programming


Passing Variables and Form Submission

Here u will make user select a Option in a Radio Button and Pass the Variable value to next Card of WML

 
 The GO task represents the action of switching to a new card
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 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.
<?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="Java">Java Tutorial</option>
  <option value="PHP">PHP Tutorial</option>
  <option value="Oracle">Oracle Tutorial</option>
</select>
</p>
</card>

<card id="card2" title="Answer">
<p>
You selected: $(name)
</p>
</card>

</wml>
 Running the code
1) save the above file as form.wml, page2.wml in E:\wml\ Directory
2) Open UPSDK Browser, which will be a shortcut created during installation
3) Type in the URL file://e:/wml/form.wml next to GO Button Text Box, Hit Enter ..........
4) Always remember whenever u make changes to the wml script, u must click on Edit Clear Cache to View New Screen and Re-Enter URL
 What Next ? Dynamic Data Display from JSP
 Reach me!
   My Web URL : http://www.geocities.com/james_smith73
   If you like this article and/or code mailme or Join our small Group of Java Programmers ,
Till we meet next time BYE     

  Java, J2EE, J2SE and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the United States and other countries.