attribute gives the name of the form control, as used in form
submission and in the
elements object. If the attribute
is specified, its value must not be the empty string.
Any non-empty value for
is allowed, but the names "
_charset_" and "
isindex" are special:
This value, if used as the name of a Text control that is the first
control in a form that is submitted using the
mechanism, causes the submission to only include the value of this
control, with no name.
This value, if used as the name of a Hidden control with no
value attribute, is automatically
given a value during submission consisting of the submission
content attribute is a boolean attribute.
A form control is disabled
disabled attribute is
set, or if it is a descendant of a
is set and is not a descendant of that
fieldset element's first
child, if any.
Form controls have a value
and a checkedness. (The latter
is only used by
input elements.) These are used to
describe how the user interacts with the control.
content attribute allows the author to indicate that a control is to
be focused as soon as the page is loaded or as soon as the
dialog within which it finds itself is shown, allowing
the user to just start typing without having to manually focus the
autofocus attribute is
a boolean attribute.
An element's nearest ancestor autofocus scoping root
element is the element itself if the element is a
dialog element, or else is the element's nearest
dialog element, if any, or else is the
element's root element.
There must not be two elements with the same nearest
ancestor autofocus scoping root element that both have the
Let target be the element's
If target has no browsing context, abort these steps.
If target's active sandboxing flag set has the sandboxed automatic features browsing context flag, abort these steps.
If the user agent has already reached the last step of this
list of steps in response to an element being inserted into a
Document whose top-level browsing
context's active document is the same as target's top-level browsing context's
active document, abort these steps.
If the user has indicated (for example, by starting to type in a form control) that he does not wish focus to be changed, then optionally abort these steps.
Queue a task that checks to see if the element is focusable, and if so, runs the focusing steps for that element. User agents may also change the scrolling position of the document, or perform some other action that brings the element to the user's attention. The task source for this task is the DOM manipulation task source.
Focusing the control does not imply that the user agent must focus the browser window if it has lost focus.
IDL attribute must reflect the content attribute of the
In the following snippet, the text control would be focused when the document was loaded.
<input maxlength="256" name="q" value="" autofocus> <input type="submit" value="Search">
A form control
maxlength attribute, controlled by a dirty value flag, declares a limit on the number of
characters a user can input.
If an element has its form
maxlength attribute specified,
the attribute's value must be a valid non-negative
integer. If the attribute is specified and applying the
rules for parsing non-negative integers to its value
results in a number, then that number is the element's maximum
allowed value length. If the attribute is omitted or parsing
its value results in an error, then there is no maximum
allowed value length.
Constraint validation: If an element has a maximum allowed value length, its dirty value flag is true, its value was last changed by a user edit (as opposed to a change made by a script), and the code-unit length of the element's value is greater than the element's maximum allowed value length, then the element is suffering from being too long.