Page 133 - DCAP512_WAP_AND_WML
P. 133

Unit 9: Working with user Input




          submit the form data to the server for further processing. To submit data to the server in WML,  Notes
          you need the <go></go> and <postfield/> tags. The <postfield/> tag should be enclosed in the
          <go></go> tag pair.
          Let’s first have a look at the following WML example before we go into the details:


                 Example: (sendDataEg1.wml)
          <?xml version=”1.0"?>
          <!DOCTYPE  wml  PUBLIC  “-//WAPFORUM//DTD  WML  1.3//EN”  “http://
          www.wapforum.org/DTD/wml13.dtd”>
          <wml>

            <card id=”card1" title=”WML Form”>
              <onevent type=”onenterforward”>
                <refresh>
                  <setvar name=”my_temp_id” value=”123456"/>
                </refresh>
              </onevent>

              <p>
                Hello, welcome to our WML tutorial.<br/>
                What’s your name?<br/>
                <input name=”myName”/><br/>
                Are you a boy or a girl?<br/>
                <select name=”myGender”>
                  <option value=”Boy”>I am a boy</option>
                  <option value=”Girl”>I am a girl</option>
                </select><br/>

                Which part of our WML tutorial do you like?<br/>
                <select name=”favorite_tutorial_part” multiple=”true”>
                  <option value=”Part 1">Part 1</option>
                  <option value=”Part 2">Part 2</option>
                  <option value=”Part 3">Part 3</option>
                  <option value=”Part 4">Part 4</option>
                </select><br/><br/>

                <anchor>
                  <go method=”get” href=”processing.asp”>
                    <postfield name=”name” value=”$(myName)”/>
                    <postfield name=”gender” value=”$(myGender)”/>
                    <postfield name=”tutorial_part” value=”$(favorite_tutorial_part)”/>
                    <postfield name=”temp_id” value=”$(my_temp_id)”/>




                                           LOVELY PROFESSIONAL UNIVERSITY                                   127
   128   129   130   131   132   133   134   135   136   137   138