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
on a form control element enables the submission of the
directionality of the element, and gives the name of the
field that contains this value during form submission.
If such an attribute is specified, its value must not be the empty
In this example, a form contains a text field and a submission button:
<form action="addcomment.cgi" method=post> <p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p> <p><button name="mode" type=submit value="add">Post Comment</button></p> </form>
When the user submits the form, the user agent includes three fields, one called "comment", one called "comment.dir", and one called "mode"; so if the user types "Hello", the submission body might be something like:
If the user manually switches to a right-to-left writing direction and enters "مرحبًا", the submission body might be something like:
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.
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.