Next / Previous / Contents / TCC Help System / NM Tech homepage

8. The reset button

You can provide a button that restores the form to its initial contents:

<input type="reset" value="label">

As with the submit button, the value attribute is optional and specifies the text that appears on the button. The default text is value="Reset".

When a user clicks the reset button on a form, all the form elements are reset to the same value they had when the page is first loaded. Text fields, for example, are reset to their value attribute; fields with no value attribute become blank. Each radiobutton group is cleared except for the radiobutton that has the checked attribute. Checkboxes with the checked attribute become set, and those without that attribute are cleared, and so forth.