form.reset() and form.submit() Methods : Form Reset « Form Control « JavaScript DHTML






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> 

   
    
    
  








Related examples in the same category

1.Reset the fields in a form
2.The onreset and onsubmit Event Handlers