<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.java2java.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> </td>
<td> <input type="submit" value="Submit Form"/></td>
</tr>
</table>
</form>
</body>
</html>
|