Form.onReset : Form Object « Form « JavaScript Tutorial






Syntax

onReset="command"

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

<html>
    <head>
    <title>Using the onReset event handler</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function showMsg(){
       document.form2.msg.value = "You have cleared the Entry Fields.";
    }
    -->
    </script>
    <form name="form1" onReset='showMsg()'>
    Entry 1:<input type= "text" name="text1" size="20"><br>
    Entry 2:<input type= "text" name="text2" size="20"><br>
    Entry 3:<input type= "text" name="text3" size="20"><br>
    <input type="reset" value= name="Reset"
    </form>
    <form name="form2">
    Message:<input type="text" name="msg" size="50">
    <br><br>
    </form>
    </body>
    </html>








10.2.Form Object
10.2.1.Form
10.2.2.Using the Forms Array
10.2.3.Form.action
10.2.4.Form.elements
10.2.5.Form.elements.length
10.2.6.form.encoding
10.2.7.Form.handleEvent()
10.2.8.Form.length
10.2.9.Form.method
10.2.10.Form.name
10.2.11.Form.onReset
10.2.12.Form.onSubmit
10.2.13.Form.reset()
10.2.14.Form.submit()
10.2.15.Form.target