Form.onReset

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

onReset="command"

Description

The onReset method of the Form object executes JavaScript code when a reset event occurs.

Example

Listing 7.263 demonstrates the use of the onReset event handler. The JavaScript function checks to see if the Reset button has been clicked. If so, all the text values are reset to a specified value.

Listing 7.263 Using the onReset Event Handler
 <html> <head> <title>Using the onReset event handler</title> </head> <body> <script language="JavaScript"> <!-- Hide // function displays a message when the onReset event handler determines that // the reset button has been pressed. function showMsg(){ document.form2.msg.value = "You have cleared ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.