I'm putting together a basic contact form for a standard business/company site. First name, last name, email, phone number and message. I was tempted to put a "clear" button to clear the form and I thought to myself is this necessary. IE puts the clear marker at the end of each field. Is the clear button necessary for the contact forms?
It depends on your situation; a simple one page contact / enquiry form does not need a reset form. Why would you need to reset anything since nothing has been stored yet. If you really need to start over, you could always just refresh the page.
However, if you have a form consisting of multiple pages, the filled in fields have most likely been stored in for instance a session. In that case you should offer a reset button as of the second page.
I would say it depends on wether or not any data has been saved yet that can be cleared.
Well, it was old almost from its own conception. Think about this: how many times will you need to clear ALL info in ALL fields of a form? Now ask anyone you know and you'll probably have a very basic research study that will propably yield an absolute result: NEVER.
And like I said, even at the beginnings (well, almost) of web applications this was considered an useless element. As early as year 2000, Jakob Nielsen advocated for the ban of the clear and reset buttons, with some caveats. And of course, that article is old and some of the views on that article aren't very valid nowadays, but still worth a reading. See what he said about the cancel button:
Cancel: Use Sparingly
The Web is not an application environment, and it usually doesn't have dialog boxes. Instead, the Web is a navigation environment where users move between pages of information. Since hypertext navigation is the dominant user behavior, users have learned to rely on the Back button for getting out of unpleasant situations. Whenever users arrive at pages they don't want, they slam their mouse directly onto the Back button.
Because Back is such a strong behavior on the Web, it is usually not necessary to offer explicit Cancel buttons. If the user asks for something but doesn't want it, then you can be sure that it's Back button time.
Offer a Cancel button when users may fear that they have committed to something they want to avoid. Having an explicit way to Cancel provides an extra feeling of safety that is not afforded by simply leaving.
Cancel is mainly useful for multi-step dialogs where the user has progressed past one or more pages with actions. At this time, pressing the Back button will not undo these actions and it would be better if the user would click Cancel.
Of course, one cannot rely on having the user click Cancel , even if it is offered, so the back-end logic must be able to handle abandoned multi-step dialogs where the user decided to leave through the use of the Back button. This added complexity is one of the reasons I don't recommend trying to implement advanced applications inside a Web browser. It is better to use another form of Internet-enabled applications.
Also, the clear button adds some complexities to the flow:
- the cancel/clear button in forms users may accidentally click that button and there's no confirmation messages to cancel that action, which adds a lot of frustration
- it adds an additional level of friction, because there's another possible action, making the user guess why is that there
- affordance is confusing: what are you going to clear? what are you going to cancel? what are you going to reset? See how all these words are used for the same button, yet they all do and serve for different purposes. Now think that the user has seen all these option many times, sometimes well used, sometimes not. What are you going to use that doesn't add friction to the experience?
- finally, what problem does the clear/cancel button solve? What additional benefits provide?
In short, it's quite easy to see that button is quite useless, as long as you don't need to use it where Nielsen mentions (multi-step forms, upload/download data and such, in that case you'll need a CANCEL button rather than a CLEAR button)