Reset Buttons

Preferences - Do not show ads

HTML provides a way for you to create reset buttons. When a reset button is clicked, the form is reset to its default values. Unlike HTML, WML does not support the creation of reset buttons. However, you can use a way similar to what we described in the last section to create an anchor link that works like a reset button. Here is an example:


(resetButtonsEg1.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">
    <p>
      User name:<br/>
      <input name="myUserName"/><br/>

      Password:<br/>
      <input name="myPassword" type="password"/><br/><br/>

      <anchor>
        <go method="get" href="resetButtonsProc.asp">
          <postfield name="name" value="$(myUserName)"/>
          <postfield name="password" value="$(myPassword)"/>
        </go>
        Submit Data
      </anchor><br/>

      <anchor>
        <refresh>
          <setvar name="myUserName" value=""/>
          <setvar name="myPassword" value=""/>
        </refresh>
        Reset Form
      </anchor>

    </p>
  </card>
</wml>


The result of the above WML example in some mobile phone browsers is shown below:






Sony Ericsson T610





Sony Ericsson T68i





Nokia Mobile Browser 4.0


Enter something in the input fields, like this:



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


If you click the "Reset Form" anchor link, the input fields will be reset to their default values.



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


Previous Page Page 50 of 50

Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?






WML Tutorial Table of Contents WML Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page