Reset ElementNameReset Element---a button to reset a form's valuesAvailabilityNavigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0 Synopsis
form.name form.elements[i] Properties
HTML SyntaxA Reset element is created with a standard HTML <INPUT> tag, with the addition of the onClick attribute:
<FORM> ... <INPUT TYPE="reset" specifies that this is a Reset button [ VALUE="label" ] the text that is to appear within the button specifies the value property [ NAME="name" ] a name that can later be used to refer to the button specifies the name property [ onClick="handler" ] JavaScript statements to be executed when the button is clicked > ... </FORM> DescriptionThe Reset element has the same properties and methods as the Button element, but has a more specialized purpose. When a Reset element is clicked on, all input elements in the form that contains it will have their values reset back to their initial default values. (For most elements this means to the value specified by the HTML VALUE attribute.) If no initial value was specified, then a click on the Reset button will "clear" any user input from those elements. UsageIf no VALUE attribute is specified for a Reset element, it will be labelled Reset. In some forms, it may be better to label the button Clear Form or Defaults. In Navigator 3.0, you can simulate the action of a Reset button with the reset() method of the Form object. Also in Navigator 3.0, the onreset() event handler of the Form object will be invoked before the form is reset. This event handler can cancel the reset by returning false. |
|