22.1. Reset Buttons
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:
<?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:
|
|
|
Enter something in the input fields, like this:
|
|
|
If you click the "Reset Form" anchor link, the input fields will be reset to their default values.
|
|
|
Previous Page | Page 50 of 50 |
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML