demosthenes.info

I’m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

A Sass color keyword system for designers. Replaces CSS defaults with improved hues and more memorable, relevant color names.

CSSslidy: an auto-generated #RWD image slider. 3.8K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

HTML Forms: submit and reset

html / forms

Estimated reading time: 1 minute

When all is said and done, the user needs to indicate that they are finished entering information with the form and want to submit it. This is done with a submit button, which is usually the last (or second-to-last) tag before the closing </form> tag:

<input type="submit">

The value attribute of the submit button is the text displayed on the button itself. This value should be assigned, since different browsers will make different assumptions about the displayed text otherwise (Most browsers will assume that the text should be “Submit Query”).

<input type="submit" value="Go!">

While it is not necessary to place an id or name on the submit button, doing so can be useful for the purposes of validating the form information, which I cover in the section.

Reset

A reset button sets the form back to its default settings. Be very careful where you place a reset button: too close to the submit button and some users will inevitably accidentally click on it rather than the submit button by mistake, and there is no way to get back their information once they have done so. Physically separate the submit and reset buttons with a space at the very least, or skip the reset button entirely.

<input type="reset" value="Reset form">
comments powered by Disqus

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.