Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Form onReset

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>