Working with Reset Buttons


Clicking a reset button (Figure 68.10) causes the browser to return all fields in the form to their default values. If a field doesn't have a default value, the browser clears the field instead.

Figure 68.10. Add a reset button to allow your visitor to return the form to its default state.


TIP

You can add as many reset buttons as you like, but you really only need one per form. The best place for the button is usually at the bottom of the form, to the right of the submit button.


Listing 68.10. View Source for Figure 68.10.
 <form>   <input type="reset" name="fieldsReset" value="Reset Fields"> </form> 

The reset button's value attribute determines the text that appears on the button's face.

FAQ

What are the methods of form submission?

There are two: GET and POST. The GET method sends the form data in plain-text format, attaching it as a long string of attribute/value pairs to the end of the form action's URL. The POST method sends the form data in a separate message, almost like a private email between the browser and the Web server.




Web Design Garage
Web Design Garage
ISBN: 0131481991
EAN: 2147483647
Year: 2006
Pages: 202
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net