jim.shamlin.com

Reset Button

Renders a button that will return all elements of the form to their default values.


Basics

Bare-bones code for a button is:

<INPUT TYPE="reset" VALUE="Label">

This renders the button only with the VALUE appearing as text on the button. It's possible to omit the VALUE, but the button may not display at all if this is done.


Usage

The "reset" button is used to undo all of the actions a user has taken on a form. The elements will be restored to their default values.


Processing

A reset button does not pass any data to the server for processing.


HTML Attributes

A reset button typically has only name and value (and the name is often omitted), but may also have the following:

Worth noting: the text supplied as the VALUE will be displayed on the button, and may be text only (not HTML code to format it)


JavaScript

Properties

A reset button has no unique or unusual JavaScript properties.

Methods

Event Handlers


Misc Notes

A "reset" button is seldom ever useful. Some developers include them as a matter of course, regardless of whether it makes sense to have one.

The reset button affects all elements contained within a form, regardless of where the button is coded.

If client-side script has altered the default values of any elements, the reset button will return those elements to the altered values, not the original ones.