Resetting a form on page load : Reset : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Reset »

 

Resetting a form on page load

















<html>
<head>
<title>Resetting a form on page load</title>
<script type="text/javascript" language="javascript">
<!-- //
function ClearForm(){
    document.MyForm.reset();
}
// -->
</script>
</head>
<body onload="ClearForm()">
<table>
<form name="MyForm" action="http://www.navioo.com/" method="Post">
<tr>
 <td width="15%" align="right">First Name: </td>
 <td> <input type="text" name="FirstName"/></td>
</tr>
<tr>
 <td align="right">Last Name: </td>
 <td> <input type="text" name="LastName"/></td>
</tr>
<tr>
 <td align=""right">User Number: </td>
 <td> <input type="text" name="UserNo"/></td>
</tr>
<tr>
 <td>&nbsp;</td>
 <td> <input type="submit" value="Submit Form"/></td>
</tr>
</table>
</form>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Reset