fbpx
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


I'm a Full stack developer of IT exp in J2EE, AngularJs, MicroServices, Docker, Spring (Boot, MVC, Cloud), Bluemix, DevOps. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

Advertisements
%d bloggers like this: