This document provides annotated links to tutorials, references, FAQs, and my specialized documents about HTML forms.
To use HTML forms, you need to know how to write a
FORM
element, containing suitable fields. That's covered
well in the tutorials mentioned below. But additionally, you need
a form handler, which is some software which processes
the form data in some way, e.g. by sending it by E-mail to you or
by storing it to a file which you can access. There are several
possibilities:
Warning: The use of
action="mailto:..."
is often suggested.
However, it has
undefined effect.
Although some browsers in some configurations support it,
the above-mentioned approach is much better - more reliable and
more flexible (allowing e.g. nice formatting of the data and redirecting
the user to a "thank you" page, etc).
Thus,
you should never use action="mailto:..."
on Web pages!
See also: The mythical Mailto:.
mailto:
URLs for forms processing
(though with some warnings).
FORM
element
in my
Learning
HTML 3.2 by Examples was written to be a reference
illustrated with examples rather than a tutorial. However,
parts of it and the other sections (on form fields) linked to it can
perhaps be used also as a tutorial to forms as defined in HTML 3.2.
The ultimate reference on HTML is currently the HTML 4.01 Specification, which contains a separate section on forms. Please note that many of the features have not been implemented yet even in newest versions of browsers. For some browser vendors' own words about the implementations, see section Forms in Netscape's HTML Tag Reference and the descriptions in Microsoft's HTML Elements (which describes the HTML support in Internet Explorer).
The
HTML 4.0 Reference by
WDG
contains detailed descriptions of all constructs in
HTML 4.0 and examples of their usage.
(The elements directly related to forms are:
BUTTON
,
FIELDSET
,
FORM
,
INPUT
,
LABEL
,
LEGEND
,
OPTGROUP
,
OPTION
,
SELECT
,
TEXTAREA
.)
It also provides, in the
element descriptions, links to the ultimate specifications:
applicable sections in HTML 2.0, HTML 3.2, and HTML 4
specifications.
That reference also contains warnings about HTML 4
form features not implemented yet in most browsers. See
section Forms
in
HTML 4.0 in Netscape and Explorer for a good summary
of the status of browser support
(and
my margin
notes to it for some details).
There are several questions related to forms in WDG's Web Authoring FAQ, including
See also:
FORM
submission and i18n,
"ad-hoc tutorial-ish notes" on problems with entering other
than US-Ascii data, also by Alan.
Note that some of the documents of mine listed below answer other frequently asked questions like "how do I create pulldown menu for navigation", "how do I get rid of the ugly grey button", and "how do I control how form fields are displayed".
I have written some documents on special topics about forms or related to them:
accesskey
attribute
in HTML forms and links
As regards to accessibility of forms in general, I'd recommend Jim Thatcher's Accessible Forms in his Web Accessibility for Section 508 and the material How to Create Accessible Forms at WebAIM.
SELECT
and OPTION
,
INPUT TYPE="RADIO"
and INPUT TYPE="CHECKBOX"
elements. Describes techniques for specifying
default choices and why
they are important.
SELECT
menu?
FIELDSET
).
GET
and POST
in HTML forms - what's the difference?