input (type="reset") | NN 2 IE 3 DOM 1 | |||||||||||||||||||||||||||||||||||
The reset object is a form control generated with an input element whose type attribute is set to reset. This element is similar to the button object. No script action is necessary for the reset object to do its job of restoring form controls to their default settings. |
||||||||||||||||||||||||||||||||||||
HTML Equivalent | ||||||||||||||||||||||||||||||||||||
<input type="reset"> |
||||||||||||||||||||||||||||||||||||
Object Model Reference | ||||||||||||||||||||||||||||||||||||
[window.]document.formName.elementName [window.]document.forms[i].elements[i] [window.]document.getElementById("elementID") |
||||||||||||||||||||||||||||||||||||
Object-Specific Properties | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Object-Specific Methods | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Object-Specific Event Handler Properties | ||||||||||||||||||||||||||||||||||||
|
form | NN 2 IE 3 DOM 1 |
Read-only | |
Returns a reference to the form element that contains the current element (if any). When processing an event from this element, the event handler function automatically has access to the input element (as the event object's target or srcElement property). By reading the form property, the script can easily access other controls within the same form. |
|
Example | |
var theForm = evt.srcElement.form; |
|
Value | |
form element object reference. |
|
Default | |
None. |
name | NN 2 IE 3 DOM 1 |
Read/Write | |
This is the identifier associated with the form control. Names are hidden from user view, since control labels are assigned via other means, depending on the control type. Form control names may also be used by script references to the objects. |
|
Example | |
document.orderForm.myReset.name = "resetter"; |
|
Value | |
Case-sensitive string identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. |
|
Default | |
None. |
type | NN 3 IE 4 DOM 1 |
Read-only | |
Returns the type of form control element. The value is returned in all lowercase letters. It may be necessary to cycle through all form elements in search of specific types to do some processing on (e.g., emptying all form controls of type "text" while leaving other controls untouched). |
|
Example | |
if (document.forms[0].elements[3].type == "reset") { // process reset input type here } |
|
Value | |
Any of the following constants (as a string): button | checkbox | file | hidden | image | password | radio | reset | select-multiple | select-one | submit | text | textarea. |
|
Default | |
reset |
value | NN 2 IE 3 DOM 1 |
Read/Write | |
This is one of the rare times that the value property controls the label of a form control: the text that appears on the reset button. |
|
Example | |
document.forms[0].myReset.value = "Undo"; |
|
Value | |
String. |
|
Default | |
Reset |
createTextRange( ) | NN n/a IE 4(Win) DOM n/a |
Creates a TextRange object containing the button's label text. See the TextRange object for details. |
|
Parameters | |
None. |
|
Returned Value | |
TextRange object. |
handleEvent[ ] | NN |4| IE n/a DOM n/a |
handleEvent(event) | |
Instructs the object to accept and process the event whose specifications are passed as the parameter to the method. The object must have an event handler for the event type to process the event. Navigator 4 only. |
|
Parameters | |
|
|
Returned Value | |
None. |