Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

TYPE = RESET

RESET resets the form so that it is the way it was before anything was typed in:

<FORM ACTION="../cgi-bin/mycgi.pl">
<INPUT TYPE=TEXT>
<INPUT TYPE=SUBMIT> 
<INPUT TYPE=RESET>
</FORM>

which gives us:

For a while it was the perception that all forms "had" to have a reset button, but designers have found that resets are more likely to detract from the form than add to it. Users don't usually need to reset their forms, and they are more likely to accidentally hit the reset button than they are to actually want to wipe out their work. Unless you have a specific reason to expect that users will need a reset button it's probably best to leave it out.

If you do choose to use have a reset button in your form, consider adding a check if the user actually wants to reset. You can do this by adding an onReset event handler to the <FORM ...> tag:

<FORM 
   ACTION="../cgi-bin/mycgi.pl" 
   onReset="return confirm('Do you really want to reset the form?')"
   >
<INPUT TYPE=TEXT NAME="query">
<INPUT TYPE=SUBMIT> 
<INPUT TYPE=RESET>
</FORM>

which creates this form:

If you add the VALUE attribute to the tag then that value is used as the text for the button.

<FORM 
   ACTION="../cgi-bin/mycgi.pl" 
   onReset="return confirm('Do you really want to reset the form?')"
   >
<INPUT TYPE=TEXT NAME="query">
<INPUT TYPE=SUBMIT> 
<INPUT TYPE=RESET VALUE="Start All Over">
</FORM>

which gives us:

 
 
  Copyright 1997-2002 Idocs inc. Published under the terms of the Open Content License Design by Interspire