[Contents] [Previous] [Next] [Index]

onReset

Executes JavaScript code when a reset event occurs; that is, when a user resets a form (clicks a Reset button).

Event handler for

Form

Implemented in

Navigator 3.0

Syntax

onReset="handlerText"

Parameters

handlerText
JavaScript code or a call to a JavaScript function.

Examples

The following example displays a Text object with the default value "CA" and a reset button. If the user types a state abbreviation in the Text object and then clicks the reset button, the original value of "CA" is restored. The form's onReset event handler displays a message indicating that defaults have been restored.

<FORM NAME="form1" onReset="alert('Defaults have been restored.')">
State:
<INPUT TYPE="text" NAME="state" VALUE="CA" SIZE="2"><P>
<INPUT TYPE="reset" VALUE="Clear Form" NAME="reset1">
</FORM>

Event properties used

type
Indicates the type of event.

target
Indicates the object to which the event was originally sent.

See also

Form.reset, Reset

For general information on event handlers, see "General Information about Events".

For information about the event object, see event.


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:34:02


Copyright © 1997 Netscape Communications Corporation