- FORM element
- INPUT element
- SELECT element
- OPTGROUP element
- OPTION element
- LABEL element
- TEXTAREA element
- LEGEND element
- BUTTON element
Aside from hyperlinks, forms are the main way users interact with the Web. Among their varied critical uses, forms allow people to:
- Find what they want via search engines
- Publish their thoughts online via blogs
- Enter their personal details and make purchases via e-commerce sites
The standards bodies keep trying to create successors to the current popular incarnation of forms in order to make things easier for creators and to provide a richer experience for users (check out the XForms spec and the WebForms 2.0 spec). By MAMA's representation statistics, authors do not seem to be embracing the newer forms features yet in significant quantities. The XForms namespace was only found in 16 of MAMA's URLs, and syntax from the most popular new features in Web Forms 2.0 numbers just over 100 detected cases. (Bear in mind that, at the time of writing, Web Forms 2.0 was a nascent technology, with fairly limited browser support.) Forms in general are very popular—found on up to one-third of all pages analyzed.
The popularity of the main types of form elements varies widely, and sometimes
surprisingly. For example, almost every
FORM has an
INPUT element, but relatively few make use of
Such variations may be due to a number of factors, including inherent biases in
MAMA's current URL set (a majority of MAMA's URLs are Surface/Home pages). The
intended use of a Web page often dictates the types of elements used, including
Form elements frequencies
We will start our look at form elements by looking at its main container element:
FORM. Notice that the
attribute is used on most pages—it specifies what to do with the information
the form is collecting. This attribute is required, so the dominance here is
Method attribute is only slightly
less popular than the required
Action attribute (found in 89.39%
of all form usage). The
Name attribute is just over
twice as popular as the
Id attribute for this element.
| ||977,934|| ||31,845|
| ||930,343|| ||8,775|
| ||570,643|| ||1,569|
| ||266,886|| ||0|
Approximately 70% of pages that specify an explicit HTTP Method use the
"post" method, while ~46% use the "get"
method (some documents had pages with multiple forms that had a mixture of methods). This would indicate a clear authoring preference for the
"post" method, but there are a few factors to
consider. Up to 15% of the pages specifying the
attribute use multiple forms on the page that mix both
"post" and "get" methods.
There are 110,428 URLs that used the
Method attribute; "get"
is the implied default value in such cases. This brings the relative preferences
Method among all
usages much closer: 62.19% for "post" and 51.56% for
an explicit or implied "get" value.
The full frequency table for this attribute
shows other values, including a number of typos, but they appear inconsequential
next to the two main, accepted values.
MAMA kept track of the values for this attribute, although it was not known in advance if it was used in significant quantities (it was detected only 8,775 times). The most popular value is clearly "utf-8", with "iso-8859-1" also being very common. Other than those, Japanese encodings held sway with 3 of the next 4 most popular values.
This popular element is used in 96.90% of all documents using forms. With the
element's functionality being as overloaded as it is, this popularity is both
understandable and expected. Many of the attributes listed below in Fig 3-1
are only used with specific
Type attribute values,
so we will look at the
Type attribute before saying
anything more about the other attributes.
|1,008,545|| ||172,843|| ||8,358|
| ||1,005,152|| ||135,049|| ||5,053|
| ||990,058|| ||120,420|| ||3,936|
| ||947,403|| ||119,902|| ||3,314|
| ||656,354|| ||70,163|| ||3,184|
| ||335,990|| ||35,501|| ||2,688|
| ||329,415|| ||34,725|| ||1,892|
| ||213,924|| ||10,193|| ||929|
|Attribute value||Frequency||Attribute value||Frequency|
Now, our discussion of the
INPUT element gets more interesting:
- The "empty" value indicates that an
INPUTelement did not have a
Typeattribute at all. In such situations, a widget is interpreted as
Type="Text". In all, 79,050 URLs used
INPUTelements where none of them specified a
- The most popular attribute value is
Type="Text", but "Hidden" is also very popular.
- The next most popular
Typevalues are "Submit" and then "Image". Because "Image" is a type of submittal, and each of the two mentioned will often be used to the exclusion of the other, looking at their combined totals shows that submittal is the most popular function of forms (more popular than "Text"). This is actually an expected result.
Type="Image" has a much higher representation than expected, with up to one-third of
INPUTinstances using graphical submit buttons instead of the default "Submit" widget.
Type="Image" related attributes:
Hspace(horizontal dimensions) have just a slight edge over
Vspace(vertical dimensions), the same as in the case of the
Srcattribute is used 335,990 times, compared with 337,286 times for
Type="Image"— a difference of 1,296 URLs not having any
Src. This does not make a lot of sense and might warrant further investigation.
- In the early days of forms, most "Submit" buttons were paired with a "Reset" button, but today, that seems to be passé. By comparison, "Reset" is rarely encountered now.
Maxlengthattributes (used with
Type="Text") are both quite popular overall, but
Sizeis about twice as popular as
- The exclusive choice widget,
Type="Radio", is twice as popular as the multi-choice
- The invalid sequence
Type="Input" occurs more often than
Type="File". On the surface, this seems unusual, but this outcome may be quite reasonable. The
Type="File" sequence is often used with more complex Web application pages that are not presented as often on the main Surface/Home pages that compose the majority of MAMA's URL set.
The popular values for the
Size attribute (used with
definitely show a pattern. Authors really like multiples of 5, although the
most popular explicit value - "20" - is also the
default size used in most browsers.
Aside from the overloaded
INPUT element, the
SELECT element is the next most popular of the form
widgets. The use of the
Multiple attribute was much lower than I
expected; it only just beats out
Disabled for last
place with usage in 0.64% of all
SELECT lists. The
Name attribute is used with most
elements (96.48%), and
Name dominates over the
Id attribute again by a 4-to-1 ratio.
| ||275,323|| ||1,826|
| ||70,201|| ||1,515|
Size attribute is only used in ~25% of all
SELECT lists, but as you can see from the frequency
data for the attribute value, the size that is specified the most is 1 (93.26%
of the time). Since this the typical default size in most browsers, the value
is probably automatically inserted as such by many Web page editors. Also of
note is that the legal
value does not even make the top 10 values, whereas some questionable values
like "0" and "-1" rank higher.
|Attribute value||Frequency||Attribute value||Frequency|
OPTGROUP was introduced in HTML 4.0, and it still
has not gained a lot of traction—it was found to be the least popular of any
of the form-related elements. When it is used, it almost
always uses the
Label attribute. The other attribute
specifically defined for this element,
was only detected a paltry 4 times.
There are over 3,000 URLs in MAMA that use the
element but not the
OPTION element. It is possible
that these cases are creating the
for these lists dynamically using
SCRIPT, but that
would need some further scrutiny. Almost 97% of all URLs having
elements also use a
Value attribute with at least
one of them. The
attributes are (comparatively) rarely used, proving to be only slightly more
popular than the
| ||273,138|| ||1,325|
| ||163,967|| ||1,017|
It is not necessary for a
LABEL element to have a
For attribute in order to directly associate it with
another element, but most authors do so (88% of the time). The representation
Accesskey attribute seems quite low, but that
is a little deceiving; only the
INPUT elements had higher numbers for the attribute.
I found it rather surprising that
TEXTAREA was used
in only 3.50% of all pages using the
Perhaps the dominance of top-level pages in MAMA's URL set had something to
do with the usage numbers. The
TEXTAREA element is often a
workhorse for more serious applications than what you would likely
find on a glossy/glitzy home page. The
has a slight edge over the
Cols attribute in usage,
but both attributes are found at the same time in 31,046 URLs. In all, 3,136 URLs used
TEXTAREA elements without any
Cols attributes (less than 10% of all URLs using
TEXTAREA), leaving the browser to use the default
dimensions. Note that the
Name attribute maintains
its dominance again over the
Id attribute by a wide margin.
| ||32,754|| ||1,668|
| ||32,500|| ||1,570|
| ||31,566|| ||91|
| ||9,183|| ||79|
Wrap attribute values
The values for this attribute have never been well documented. In addition to
a number of other values, there are three combinations that seem to be an
attempt to control the same behavior of a
and "Off" all seem to be much more popular than
their corresponding opposite attribute value. HTML5's
Web Forms 2.0
codifies the "Soft"/"Hard"
values, but as can be seen, these are not the values that are the most widely used.
|Wrap Attribute value||Frequency|
The "bounding box" visual effect that the
element creates is usually paired with a
traditional user interface usage, so it is odd that only 57.68% of
FIELDSETs have a
element. Additionally, very few authors subsequently use the
This element is rarely used in comparison to the
Type attribute values that it subsumes. The
are still the preferred method for accomplishing their respective tasks. Even
so, this forms latecomer still has some respectable numbers given its relatively
recent arrival. Notice that the
Id ratio is much closer than with other, older forms widgets.
Given that the
Type attribute has a default value
of "Submit", and submittal is the top function from the
INPUT element that
replicates, it seems a little peculiar that having an explicit
attribute has fairly high usage (~80%). MAMA did not track the
attribute for this element the way it did for the
INPUT, but it is expected that
Type="Submit" would be
the dominant value here as well.
| ||9,079|| ||464|
| ||4,246|| ||59|
This article is licensed under a Creative Commons Attribution, Non Commercial - Share Alike 2.5 license.