Mega Code Archive

 
Categories / JavaScript DHTML / Form Control
 

Form reset() and form submit() Methods

<html>  <head>  <title>Registration Form</title>  </head>  <body>  <form name="entries" method="POST" action="">  Enter your first name:<input type="text" name="firstName" id="firstName" />  <p>Enter your last name:<input type="text" name="lastName" id="lastName" /></p>  <p>Enter your address:<input type="text" name="address" id="address" /></p>  <p>Enter your city:<input type="text" name="city" id="city" /></p>  <p><input type="radio" name="gender" id="gender1" checked="checked"/>Male  <input type="radio" name="gender" id="gender2" />Female</p>  <p><input type="checkbox" name="retired" id="retired" />I am retired</p>  </form>  <p><a href="javascript:document.forms[0].submit()">   <img alt="image" src="submit.jpg" height="25" width="100" border="0" /></a>    <a href="javascript:document.forms[0].reset()">   <img alt="image" src="reset.jpg" height="25" width="100" border="0" /></a></p>  </body>  </html>