Pages Navigation Menu

Coding is much easier than you think

Resetting a form on page load

 

<html>
<head>
<title>Form reset on page load</title>
<script type="text/javascript" language="javascript">
<!-- //
function ClearForm(){
    document.MyForm.reset();
}
// -->
</script>
</head>
<body onload="ClearForm()">
<table>
<form name="Form" method="Post">
<tr>
 <td width="15%" align="right">Name: </td>
 <td> <input type="text" name="Name"/></td>
</tr>
<tr>
 <td align=""right">Roll Number: </td>
 <td> <input type="text" name="Roll No"/></td>
</tr>
<tr>
 <td>&nbsp;</td>
 <td> <input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>

About Mohaideen Jamil


Am currently working as a Struts 2 Developer in a reputed IT Organisations. I can help you with teaching Core java and Struts 2. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.