Page 124 - DCAP512_WAP_AND_WML
P. 124

WAP & WML




                    Notes
                                          Examples:
                                          <do type =”accept” label=”Initialize”>

                                                 <refresh>
                                                        <setvar name =”name” value=”John” />
                                                 </refresh>
                                          </do>

                                          <p>
                                                 Our name
                                                 <input title= “name” name =”name1" />
                                          </p>

                                   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>

                                   Variables in Content
                                          <wml>
                                                 <card id =”card1">
                                                        <p>
                                                               No variables set. <br/>
                                                               <anchor>

                                                                       <go href =”#card2">
                                                                       <setvar name =”var1" value=”Scrumpy”/>
                                                                       </go>
                                                                       Set var1

                                                               </anchor>
                                                        </p>


          118                               LOVELY PROFESSIONAL UNIVERSITY
   119   120   121   122   123   124   125   126   127   128   129