Annotation of html5/spec-author-view/attributes-common-to-form-controls.html, revision 1.22

1.1       mike        1: <!doctype html>
1.21      mike        2: <html lang="en-US-x-Hixie"><meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>4.10.19 Attributes common to form controls &mdash; HTML5: Edition for Web Authors</title><link href="style.css" rel="stylesheet"><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css"><script src="link-fixup.js" type="text/javascript"></script><style type="text/css">
1.1       mike        3: 
                      4:    .applies thead th > * { display: block; }
                      5:    .applies thead code { display: block; }
                      6:    .applies tbody th { whitespace: nowrap; }
                      7:    .applies td { text-align: center; }
                      8:    .applies .yes { background: yellow; }
                      9: 
                     10:    .matrix, .matrix td { border: hidden; text-align: right; }
                     11:    .matrix { margin-left: 2em; }
                     12: 
                     13:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                     14:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                     15:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                     16: 
                     17:    td.eg { border-width: thin; text-align: center; }
                     18: 
                     19:    #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
                     20:    #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
                     21:    #table-example-1 caption { padding-bottom: 0.5em; }
                     22:    #table-example-1 thead, #table-example-1 tbody { border: none; }
                     23:    #table-example-1 th, #table-example-1 td { border: solid thin; }
                     24:    #table-example-1 th { font-weight: normal; }
                     25:    #table-example-1 td { border-style: none solid; vertical-align: top; }
                     26:    #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
                     27:    #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
                     28:    #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
                     29:    #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
                     30:    #table-example-1 tbody td:first-child::after { content: leader(". "); }
                     31:    #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
                     32:    #table-example-1 tbody td:first-child + td { width: 10em; }
                     33:    #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
                     34:    #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
                     35: 
                     36:    .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
                     37:    .apple-table-examples * { font-family: "Times", serif; }
                     38:    .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
                     39:    .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
                     40:    .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
                     41:    .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
                     42:    .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
                     43:    .apple-table-examples td { text-align: right; vertical-align: top; }
                     44:    .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
                     45:    .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
                     46:    .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
                     47:    .apple-table-examples sup { line-height: 0; }
                     48: 
                     49:    .details-example img { vertical-align: top; }
                     50: 
                     51:    #base64-table {
                     52:      white-space: nowrap;
                     53:      font-size: 0.6em;
                     54:      column-width: 6em;
                     55:      column-count: 5;
                     56:      column-gap: 1em;
                     57:      -moz-column-width: 6em;
                     58:      -moz-column-count: 5;
                     59:      -moz-column-gap: 1em;
                     60:      -webkit-column-width: 6em;
                     61:      -webkit-column-count: 5;
                     62:      -webkit-column-gap: 1em;
                     63:    }
                     64:    #base64-table thead { display: none; }
                     65:    #base64-table * { border: none; }
                     66:    #base64-table tbody td:first-child:after { content: ':'; }
                     67:    #base64-table tbody td:last-child { text-align: right; }
                     68: 
                     69:    #named-character-references-table {
                     70:      white-space: nowrap;
                     71:      font-size: 0.6em;
                     72:      column-width: 30em;
                     73:      column-gap: 1em;
                     74:      -moz-column-width: 30em;
                     75:      -moz-column-gap: 1em;
                     76:      -webkit-column-width: 30em;
                     77:      -webkit-column-gap: 1em;
                     78:    }
                     79:    #named-character-references-table > table > tbody > tr > td:first-child + td,
                     80:    #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
                     81:    #named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
                     82:    #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
                     83: 
                     84:    .glyph.control { color: red; }
                     85: 
                     86:    @font-face {
                     87:      font-family: 'Essays1743';
                     88:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
                     89:    }
                     90:    @font-face {
                     91:      font-family: 'Essays1743';
                     92:      font-weight: bold;
                     93:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
                     94:    }
                     95:    @font-face {
                     96:      font-family: 'Essays1743';
                     97:      font-style: italic;
                     98:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
                     99:    }
                    100:    @font-face {
                    101:      font-family: 'Essays1743';
                    102:      font-style: italic;
                    103:      font-weight: bold;
                    104:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
                    105:    }
                    106: 
                    107:   </style><script type="text/javascript">
                    108:  function getCookie(name) {
                    109:    var params = location.search.substr(1).split("&");
                    110:    for (var index = 0; index < params.length; index++) {
                    111:      if (params[index] == name)
                    112:        return "1";
                    113:      var data = params[index].split("=");
                    114:      if (data[0] == name)
                    115:        return unescape(data[1]);
                    116:    }
                    117:    var cookies = document.cookie.split("; ");
                    118:    for (var index = 0; index < cookies.length; index++) {
                    119:      var data = cookies[index].split("=");
                    120:      if (data[0] == name)
                    121:        return unescape(data[1]);
                    122:    }
                    123:    return null;
                    124:  }
                    125:  function load(script) {
                    126:    var e = document.createElement('script');
                    127:    e.setAttribute('src', script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
                    128:    document.body.appendChild(e);
                    129:  }
                    130:  function init() {
                    131:    if (location.search == '?slow-browser')
                    132:      return;
                    133:    var configUI = document.createElement('div');
                    134:    configUI.id = 'configUI';
                    135:    document.body.appendChild(configUI);
                    136:    if (document.getElementById('head'))
                    137:      load('toc.js');
                    138:    load('dfn.js');
                    139:    if (getCookie('profile') == '1')
                    140:      document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
                    141:    fixBrokenLink();
                    142:  }
                    143: </script><script src="dfn.js" type="text/javascript"></script><script src="toc.js" type="text/javascript"></script><link href="association-of-controls-and-forms.html" rel="prev" title="4.10.18 Association of controls and forms">
                    144:   <link href="Overview.html#contents" rel="contents" title="Table of contents">
                    145:   <link href="textFieldSelection.html" rel="next" title="4.10.20 APIs for the text field selections">
                    146:   <body class="split chapter"><div class="head" id="head">
                    147: <div aria-haspopup="true" id="jumpIndexA-button" role="button" tabindex="0">jump
1.18      mike      148: <div id="jumpIndexA"><ul><li><a class="noindex" href="the-a-element.html#the-a-element">a</a><a class="noindex" href="the-abbr-element.html#the-abbr-element">abbr</a><a class="noindex" href="the-address-element.html#the-address-element">address</a><a class="noindex" href="the-area-element.html#the-area-element">area</a><a class="noindex" href="the-article-element.html#the-article-element">article</a><a class="noindex" href="the-aside-element.html#the-aside-element">aside</a><a class="noindex" href="the-audio-element.html#the-audio-element">audio</a></ul><ul><li><a class="noindex" href="the-b-element.html#the-b-element">b</a><a class="noindex" href="the-base-element.html#the-base-element">base</a><a class="noindex" href="the-bdi-element.html#the-bdi-element">bdi</a><a class="noindex" href="the-bdo-element.html#the-bdo-element">bdo</a><a class="noindex" href="the-blockquote-element.html#the-blockquote-element">blockquote</a><a class="noindex" href="the-body-element.html#the-body-element">body</a><a class="noindex" href="the-br-element.html#the-br-element">br</a><a class="noindex" href="the-button-element.html#the-button-element">button</a></ul><ul><li><a class="noindex" href="the-canvas-element.html#the-canvas-element">canvas</a><a class="noindex" href="the-caption-element.html#the-caption-element">caption</a><a class="noindex" href="the-cite-element.html#the-cite-element">cite</a><a class="noindex" href="the-code-element.html#the-code-element">code</a><a class="noindex" href="the-col-element.html#the-col-element">col</a><a class="noindex" href="the-colgroup-element.html#the-colgroup-element">colgroup</a><a class="noindex" href="the-command-element.html#the-command-element">command</a></ul><ul><li><a class="noindex" href="the-datalist-element.html#the-datalist-element">datalist</a><a class="noindex" href="the-dd-element.html#the-dd-element">dd</a><a class="noindex" href="the-del-element.html#the-del-element">del</a><a class="noindex" href="the-details-element.html#the-details-element">details</a><a class="noindex" href="the-dfn-element.html#the-dfn-element">dfn</a><a class="noindex" href="the-div-element.html#the-div-element">div</a><a class="noindex" href="the-dl-element.html#the-dl-element">dl</a><a class="noindex" href="the-dt-element.html#the-dt-element">dt</a></ul><ul><li><a class="noindex" href="the-em-element.html#the-em-element">em</a><a class="noindex" href="the-embed-element.html#the-embed-element">embed</a><a class="noindex" href="the-fieldset-element.html#the-fieldset-element">fieldset</a><a class="noindex" href="the-figcaption-element.html#the-figcaption-element">figcaption</a><a class="noindex" href="the-figure-element.html#the-figure-element">figure</a><a class="noindex" href="the-footer-element.html#the-footer-element">footer</a><a class="noindex" href="the-form-element.html#the-form-element">form</a></ul><ul><li><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a><a class="noindex" href="the-h1-h2-h3-h4-h5-and-h6-elements.html#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a><a class="noindex" href="the-head-element.html#the-head-element">head</a><a class="noindex" href="the-header-element.html#the-header-element">header</a><a class="noindex" href="the-hgroup-element.html#the-hgroup-element">hgroup</a><a class="noindex" href="the-hr-element.html#the-hr-element">hr</a><a class="noindex" href="the-html-element.html#the-html-element">html</a></ul><ul><li><a class="noindex" href="the-i-element.html#the-i-element">i</a><a class="noindex" href="the-iframe-element.html#the-iframe-element">iframe</a><a class="noindex" href="the-img-element.html#the-img-element">img</a><a class="noindex" href="the-input-element.html#the-input-element">input</a><a class="noindex" href="the-ins-element.html#the-ins-element">ins</a><a class="noindex" href="the-kbd-element.html#the-kbd-element">kbd</a><a class="noindex" href="the-keygen-element.html#the-keygen-element">keygen</a></ul><ul><li><a class="noindex" href="the-label-element.html#the-label-element">label</a><a class="noindex" href="the-legend-element.html#the-legend-element">legend</a><a class="noindex" href="the-li-element.html#the-li-element">li</a><a class="noindex" href="the-link-element.html#the-link-element">link</a><a class="noindex" href="the-map-element.html#the-map-element">map</a><a class="noindex" href="the-mark-element.html#the-mark-element">mark</a><a class="noindex" href="the-menu-element.html#the-menu-element">menu</a><a class="noindex" href="the-meta-element.html#the-meta-element">meta</a><a class="noindex" href="the-meter-element.html#the-meter-element">meter</a></ul><ul><li><a class="noindex" href="the-nav-element.html#the-nav-element">nav</a><a class="noindex" href="the-noscript-element.html#the-noscript-element">noscript</a><a class="noindex" href="the-object-element.html#the-object-element">object</a><a class="noindex" href="the-ol-element.html#the-ol-element">ol</a><a class="noindex" href="the-optgroup-element.html#the-optgroup-element">optgroup</a><a class="noindex" href="the-option-element.html#the-option-element">option</a><a class="noindex" href="the-output-element.html#the-output-element">output</a></ul><ul><li><a class="noindex" href="the-p-element.html#the-p-element">p</a><a class="noindex" href="the-param-element.html#the-param-element">param</a><a class="noindex" href="the-pre-element.html#the-pre-element">pre</a><a class="noindex" href="the-progress-element.html#the-progress-element">progress</a><a class="noindex" href="the-q-element.html#the-q-element">q</a><a class="noindex" href="the-rp-element.html#the-rp-element">rp</a><a class="noindex" href="the-rt-element.html#the-rt-element">rt</a><a class="noindex" href="the-ruby-element.html#the-ruby-element">ruby</a></ul><ul><li><a class="noindex" href="the-s-element.html#the-s-element">s</a><a class="noindex" href="the-samp-element.html#the-samp-element">samp</a><a class="noindex" href="the-script-element.html#the-script-element">script</a><a class="noindex" href="the-section-element.html#the-section-element">section</a><a class="noindex" href="the-select-element.html#the-select-element">select</a><a class="noindex" href="the-small-element.html#the-small-element">small</a><a class="noindex" href="the-source-element.html#the-source-element">source</a><a class="noindex" href="the-span-element.html#the-span-element">span</a></ul><ul><li><a class="noindex" href="the-strong-element.html#the-strong-element">strong</a><a class="noindex" href="the-style-element.html#the-style-element">style</a><a class="noindex" href="the-sub-and-sup-elements.html#the-sub-and-sup-elements">sub</a><a class="noindex" href="the-summary-element.html#the-summary-element">summary</a><a class="noindex" href="the-sub-and-sup-elements.html#the-sub-and-sup-elements">sup</a></ul><ul><li><a class="noindex" href="the-table-element.html#the-table-element">table</a><a class="noindex" href="the-tbody-element.html#the-tbody-element">tbody</a><a class="noindex" href="the-td-element.html#the-td-element">td</a><a class="noindex" href="the-textarea-element.html#the-textarea-element">textarea</a><a class="noindex" href="the-tfoot-element.html#the-tfoot-element">tfoot</a><a class="noindex" href="the-th-element.html#the-th-element">th</a><a class="noindex" href="the-thead-element.html#the-thead-element">thead</a><a class="noindex" href="the-time-element.html#the-time-element">time</a><a class="noindex" href="the-title-element.html#the-title-element">title</a></ul><ul><li><a class="noindex" href="the-tr-element.html#the-tr-element">tr</a><a class="noindex" href="the-track-element.html#the-track-element">track</a><a class="noindex" href="the-u-element.html#the-u-element">u</a><a class="noindex" href="the-ul-element.html#the-ul-element">ul</a><a class="noindex" href="the-var-element.html#the-var-element">var</a><a class="noindex" href="the-video-element.html#the-video-element">video</a><a class="noindex" href="the-wbr-element.html#the-wbr-element">wbr</a></ul><ul class="jumpIndexA-other"><li><a class="noindex" href="global-attributes.html#global-attributes">global attributes</a><a class="noindex" href="index-of-terms.html#index-of-terms">terms</a></ul></div></div>
1.1       mike      149: <script src="jump-indexes.js"></script><p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
                    150: 
                    151:    <h1>HTML5: Edition for Web Authors</h1>
                    152:    
                    153:    </div><div class="prev_next">
                    154:    <a href="association-of-controls-and-forms.html">&larr; 4.10.18 Association of controls and forms</a> &ndash;
                    155:    <a href="Overview.html#contents">Table of contents</a> &ndash;
                    156:    <a href="textFieldSelection.html">4.10.20 APIs for the text field selections &rarr;</a>
                    157:   <ol class="toc"><li><ol><li><ol><li><a href="attributes-common-to-form-controls.html#attributes-common-to-form-controls" id="4.10.19-attributes-common-to-form-controls"><span class="secno">4.10.19 </span>Attributes common to form controls</a>
                    158:       <ol><li><a href="attributes-common-to-form-controls.html#naming-form-controls"><span class="secno">4.10.19.1 </span>Naming form controls</a><li><a href="attributes-common-to-form-controls.html#enabling-and-disabling-form-controls"><span class="secno">4.10.19.2 </span>Enabling and disabling form controls</a><li><a href="attributes-common-to-form-controls.html#autofocusing-a-form-control"><span class="secno">4.10.19.3 </span>Autofocusing a form control</a><li><a href="attributes-common-to-form-controls.html#limiting-user-input-length"><span class="secno">4.10.19.4 </span>Limiting user input length</a><li><a href="attributes-common-to-form-controls.html#form-submission-0"><span class="secno">4.10.19.5 </span>Form submission</a><li><a href="attributes-common-to-form-controls.html#submitting-element-directionality"><span class="secno">4.10.19.6 </span>Submitting element directionality</a></ol></ol></ol></ol></div>
                    159: 
                    160:   <h4 id="attributes-common-to-form-controls"><span class="secno">4.10.19 </span><dfn aria-haspopup="true" role="button" tabindex="0">Attributes common to form controls</dfn></h4><h5 id="naming-form-controls"><span class="secno">4.10.19.1 </span>Naming form controls</h5><p>The <dfn aria-haspopup="true" id="attr-fe-name" role="button" tabindex="0"><code>name</code></dfn> content
                    161:   attribute gives the name of the form control, as used in <a href="form-submission.html#form-submission" id="form-submission_0">form
1.22    ! mike      162:   submission</a> and in the <code><a href="the-form-element.html#the-form-element" id="form_28">form</a></code> element's <code title="dom-form-elements"><a href="the-form-element.html#dom-form-elements">elements</a></code> object. If the attribute
1.18      mike      163:   is specified, its value must not be the empty string.<p>Any non-empty value for <code title="attr-form-name"><a href="the-form-element.html#attr-form-name" id="name_21">name</a></code>
1.1       mike      164:   is allowed, but the names "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset" id="_charset__0">_charset_</a></code>" and "<code title="attr-fe-name-isindex"><a href="#attr-fe-name-isindex" id="isindex">isindex</a></code>" are special:<dl><dt><dfn aria-haspopup="true" id="attr-fe-name-isindex" role="button" tabindex="0"><code>isindex</code></dfn></dt>
                    165:    <dd>
1.12      mike      166:     <p>This value, if used as the name of a <a href="states-of-the-type-attribute.html#text-state-and-search-state" id="attr-input-type-text_6" title="attr-input-type-text">Text</a> control that is the first
1.1       mike      167:     control in a form that is submitted using the <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded" id="application/x-www-form-urlencoded_0">application/x-www-form-urlencoded</a></code>
                    168:     mechanism, causes the submission to only include the value of this
                    169:     control, with no name.</p>
                    170:    </dd>
                    171: 
                    172:    <dt><dfn aria-haspopup="true" id="attr-fe-name-charset" role="button" tabindex="0"><code>_charset_</code></dfn></dt>
                    173:    <dd>
1.22    ! mike      174:     <p>This value, if used as the name of a <a href="states-of-the-type-attribute.html#hidden-state" id="attr-input-type-hidden_9" title="attr-input-type-hidden">Hidden</a> control with no <code title="attr-input-value"><a href="the-input-element.html#attr-input-value" id="value_29">value</a></code> attribute, is automatically
1.1       mike      175:     given a value during submission consisting of the submission
                    176:     character encoding.</p>
                    177:    </dd>
                    178: 
                    179:   </dl><p>The <dfn aria-haspopup="true" id="dom-fe-name" role="button" tabindex="0"><code>name</code></dfn> IDL
1.20      mike      180:   attribute must <a href="common-dom-interfaces.html#reflect" id="reflect_84">reflect</a> the <code title="attr-fe-name"><a href="#attr-fe-name" id="name_46">name</a></code> content attribute.</p>
1.1       mike      181: <h5 id="enabling-and-disabling-form-controls"><span class="secno">4.10.19.2 </span>Enabling and disabling form controls</h5><p>The <dfn aria-haspopup="true" id="attr-fe-disabled" role="button" tabindex="0"><code>disabled</code></dfn>
1.4       mike      182:   content attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_22">boolean attribute</a>.<p>A form control is <dfn aria-haspopup="true" id="concept-fe-disabled" role="button" tabindex="0">disabled</dfn>
1.18      mike      183:   if its <code title="attr-fe-disabled"><a href="#attr-fe-disabled" id="disabled_21">disabled</a></code> attribute is
1.22    ! mike      184:   set, or if it is a descendant of a <code><a href="the-fieldset-element.html#the-fieldset-element" id="fieldset_21">fieldset</a></code> element
1.1       mike      185:   whose <code title="attr-fieldset-disabled"><a href="the-fieldset-element.html#attr-fieldset-disabled" id="disabled_1">disabled</a></code> attribute
                    186:   is set and is <em>not</em> a descendant of that
1.22    ! mike      187:   <code><a href="the-fieldset-element.html#the-fieldset-element" id="fieldset_22">fieldset</a></code> element's first <code><a href="the-legend-element.html#the-legend-element" id="legend_5">legend</a></code> element
1.1       mike      188:   child, if any.</p>
                    189: <p>The <dfn aria-haspopup="true" id="dom-fe-disabled" role="button" tabindex="0"><code>disabled</code></dfn> IDL
1.20      mike      190:   attribute must <a href="common-dom-interfaces.html#reflect" id="reflect_85">reflect</a> the <code title="attr-fe-disabled"><a href="#attr-fe-disabled" id="disabled_22">disabled</a></code> content attribute.</p>
1.1       mike      191: <h5 id="autofocusing-a-form-control"><span class="secno">4.10.19.3 </span>Autofocusing a form control</h5><p>The <dfn aria-haspopup="true" id="attr-fe-autofocus" role="button" tabindex="0"><code>autofocus</code></dfn>
                    192:   content attribute allows the author to indicate that a control is to
                    193:   be focused as soon as the page is loaded, allowing the user to just
                    194:   start typing without having to manually focus the main control.<p>The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus" id="autofocus_9">autofocus</a></code> attribute is
1.4       mike      195:   a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_23">boolean attribute</a>.<p>There must not be more than one element in the document with the
1.1       mike      196:   <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus" id="autofocus_10">autofocus</a></code> attribute
                    197:   specified.</p>
                    198: <p>The <dfn aria-haspopup="true" id="dom-fe-autofocus" role="button" tabindex="0"><code>autofocus</code></dfn>
1.20      mike      199:   IDL attribute must <a href="common-dom-interfaces.html#reflect" id="reflect_86">reflect</a> the content attribute of the
1.1       mike      200:   same name.</p>
                    201: <div class="example">
                    202:    <p>In the following snippet, the text control would be focused when
                    203:    the document was loaded.</p>
                    204:    <pre>&lt;input maxlength="256" name="q" value="" autofocus&gt;
                    205: &lt;input type="submit" value="Search"&gt;</pre>
                    206:   </div><h5 id="limiting-user-input-length"><span class="secno">4.10.19.4 </span>Limiting user input length</h5><p>A <dfn aria-haspopup="true" id="attr-fe-maxlength" role="button" tabindex="0">form control <code title="">maxlength</code> attribute</dfn>, controlled by a <var title="">dirty value flag</var>, declares a limit on the number of
                    207:   characters a user can input.<p>If an element has its <a href="#attr-fe-maxlength" id="attr-fe-maxlength_2" title="attr-fe-maxlength">form
                    208:   control <code title="">maxlength</code> attribute</a> specified,
                    209:   the attribute's value must be a <a href="common-microsyntaxes.html#valid-non-negative-integer" id="valid-non-negative-integer_13">valid non-negative
                    210:   integer</a>. If the attribute is specified and applying the
                    211:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-microsyntaxes.html#rules-for-parsing-non-negative-integers" title='Read about this "rules for parsing non-negative integers" reference in the full HTML5 spec.'>rules for parsing non-negative integers</a> to its value
                    212:   results in a number, then that number is the element's <dfn aria-haspopup="true" id="maximum-allowed-value-length" role="button" tabindex="0">maximum
                    213:   allowed value length</dfn>. If the attribute is omitted or parsing
                    214:   its value results in an error, then there is no <a href="#maximum-allowed-value-length" id="maximum-allowed-value-length_4">maximum
                    215:   allowed value length</a>.<h5 id="form-submission-0"><span class="secno">4.10.19.5 </span>Form submission</h5><p><dfn aria-haspopup="true" id="attributes-for-form-submission" role="button" tabindex="0">Attributes for form submission</dfn> can be specified both
1.22    ! mike      216:   on <code><a href="the-form-element.html#the-form-element" id="form_29">form</a></code> elements and on <a href="forms.html#concept-submit-button" id="concept-submit-button_3" title="concept-submit-button">submit buttons</a> (elements that
        !           217:   represent buttons that submit forms, e.g. an <code><a href="the-input-element.html#the-input-element" id="input_124">input</a></code>
        !           218:   element whose <code title="attr-input-type"><a href="the-input-element.html#attr-input-type" id="type_77">type</a></code> attribute is
1.1       mike      219:   in the <a href="number-state.html#submit-button-state" id="attr-input-type-submit_2" title="attr-input-type-submit">Submit Button</a>
                    220:   state).
                    221: 
                    222:   <p>The <a href="#attributes-for-form-submission" id="attributes-for-form-submission_4">attributes for form submission</a> that may be
1.22    ! mike      223:   specified on <code><a href="the-form-element.html#the-form-element" id="form_30">form</a></code> elements are <code title="attr-fs-action"><a href="#attr-fs-action" id="action_2">action</a></code>, <code title="attr-fs-enctype"><a href="#attr-fs-enctype" id="enctype_2">enctype</a></code>, <code title="attr-fs-method"><a href="#attr-fs-method" id="method_2">method</a></code>, <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate" id="novalidate_1">novalidate</a></code>, and <code title="attr-fs-target"><a href="#attr-fs-target" id="target_8">target</a></code>.<p>The corresponding <a href="#attributes-for-form-submission" id="attributes-for-form-submission_5">attributes for form submission</a>
1.1       mike      224:   that may be specified on <a href="forms.html#concept-submit-button" id="concept-submit-button_4" title="concept-submit-button">submit
                    225:   buttons</a> are <code title="attr-fs-formaction"><a href="#attr-fs-formaction" id="formaction_29">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype" id="formenctype_29">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod" id="formmethod_29">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate" id="formnovalidate_31">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget" id="formtarget_29">formtarget</a></code>. When omitted, they
                    226:   default to the values given on the corresponding attributes on the
1.22    ! mike      227:   <code><a href="the-form-element.html#the-form-element" id="form_31">form</a></code> element.<hr><p>The <dfn aria-haspopup="true" id="attr-fs-action" role="button" tabindex="0"><code>action</code></dfn> and
1.1       mike      228:   <dfn aria-haspopup="true" id="attr-fs-formaction" role="button" tabindex="0"><code>formaction</code></dfn>
                    229:   content attributes, if specified, must have a value that is a
                    230:   <a href="urls.html#valid-non-empty-url-potentially-surrounded-by-spaces" id="valid-non-empty-url-potentially-surrounded-by-spaces_12">valid non-empty URL potentially surrounded by
                    231:   spaces</a>.<p>The <dfn aria-haspopup="true" id="concept-fs-action" role="button" tabindex="0">action</dfn> of an element is
                    232:   the value of the element's <code title="attr-fs-formaction"><a href="#attr-fs-formaction" id="formaction_30">formaction</a></code> attribute, if the
                    233:   element is a <a href="forms.html#concept-submit-button" id="concept-submit-button_5" title="concept-submit-button">submit
                    234:   button</a> and has such an attribute, or the value of its
                    235:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner_15">form owner</a>'s <code title="attr-fs-action"><a href="#attr-fs-action" id="action_3">action</a></code>
                    236:   attribute, if <em>it</em> has one, or else the empty string.<hr><p>The <dfn aria-haspopup="true" id="attr-fs-method" role="button" tabindex="0"><code>method</code></dfn> and
                    237:   <dfn aria-haspopup="true" id="attr-fs-formmethod" role="button" tabindex="0"><code>formmethod</code></dfn>
                    238:   content attributes are <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_13" title="enumerated attribute">enumerated
                    239:   attributes</a> with the following keywords and states:<ul><li>The keyword <dfn aria-haspopup="true" id="attr-fs-method-get-keyword" role="button" tabindex="0"><code>get</code></dfn>, mapping
                    240:    to the state <dfn aria-haspopup="true" id="attr-fs-method-get" role="button" tabindex="0">GET</dfn>, indicating
                    241:    the HTTP GET method.</li>
                    242: 
                    243:    <li>The keyword <dfn aria-haspopup="true" id="attr-fs-method-post-keyword" role="button" tabindex="0"><code>post</code></dfn>, mapping
                    244:    to the state <dfn aria-haspopup="true" id="attr-fs-method-post" role="button" tabindex="0">POST</dfn>, indicating
                    245:    the HTTP POST method.</li>
                    246: 
                    247:   </ul><p>The <i>missing value default</i> for these attributes is the
                    248:   <a href="#attr-fs-method-get" id="attr-fs-method-get_0" title="attr-fs-method-GET">GET</a> state.<p>The <dfn aria-haspopup="true" id="concept-fs-method" role="button" tabindex="0">method</dfn> of an element is
                    249:   one of those states. If the element is a <a href="forms.html#concept-submit-button" id="concept-submit-button_6" title="concept-submit-button">submit button</a> and has a <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod" id="formmethod_30">formmethod</a></code> attribute, then the
                    250:   element's <a href="#concept-fs-method" id="concept-fs-method_0" title="concept-fs-method">method</a> is that
                    251:   attribute's state; otherwise, it is the <a href="association-of-controls-and-forms.html#form-owner" id="form-owner_16">form owner</a>'s
                    252:   <code title="attr-fs-method"><a href="#attr-fs-method" id="method_3">method</a></code> attribute's state.<hr><p>The <dfn aria-haspopup="true" id="attr-fs-enctype" role="button" tabindex="0"><code>enctype</code></dfn> and
                    253:   <dfn aria-haspopup="true" id="attr-fs-formenctype" role="button" tabindex="0"><code>formenctype</code></dfn>
                    254:   content attributes are <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_14" title="enumerated attribute">enumerated
                    255:   attributes</a> with the following keywords and states:<ul><li>The "<dfn aria-haspopup="true" id="attr-fs-enctype-urlencoded" role="button" tabindex="0"><code>application/x-www-form-urlencoded</code></dfn>" keyword and corresponding state.</li>
                    256:    <li>The "<dfn aria-haspopup="true" id="attr-fs-enctype-formdata" role="button" tabindex="0"><code>multipart/form-data</code></dfn>" keyword and corresponding state.</li>
                    257:    <li>The "<dfn aria-haspopup="true" id="attr-fs-enctype-text" role="button" tabindex="0"><code>text/plain</code></dfn>" keyword and corresponding state.</li>
                    258:   </ul><p>The <i>missing value default</i> for these attributes is the
                    259:   <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded" id="application/x-www-form-urlencoded_1">application/x-www-form-urlencoded</a></code>
                    260:   state.<p>The <dfn aria-haspopup="true" id="concept-fs-enctype" role="button" tabindex="0">enctype</dfn> of an element
                    261:   is one of those three states. If the element is a <a href="forms.html#concept-submit-button" id="concept-submit-button_7" title="concept-submit-button">submit button</a> and has a <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype" id="formenctype_30">formenctype</a></code> attribute, then the
                    262:   element's <a href="#concept-fs-enctype" id="concept-fs-enctype_0" title="concept-fs-enctype">enctype</a> is that
                    263:   attribute's state; otherwise, it is the <a href="association-of-controls-and-forms.html#form-owner" id="form-owner_17">form owner</a>'s
                    264:   <code title="attr-fs-enctype"><a href="#attr-fs-enctype" id="enctype_3">enctype</a></code> attribute's state.<hr><p>The <dfn aria-haspopup="true" id="attr-fs-target" role="button" tabindex="0"><code>target</code></dfn> and
                    265:   <dfn aria-haspopup="true" id="attr-fs-formtarget" role="button" tabindex="0"><code>formtarget</code></dfn>
                    266:   content attributes, if specified, must have values that are <a href="browsers.html#valid-browsing-context-name-or-keyword" id="valid-browsing-context-name-or-keyword_1" title="valid browsing context name or keyword">valid browsing
                    267:   context names or keywords</a>.<p>The <dfn aria-haspopup="true" id="concept-fs-target" role="button" tabindex="0">target</dfn> of an element is
                    268:   the value of the element's <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget" id="formtarget_30">formtarget</a></code> attribute, if the
                    269:   element is a <a href="forms.html#concept-submit-button" id="concept-submit-button_8" title="concept-submit-button">submit
                    270:   button</a> and has such an attribute; or the value of its
1.18      mike      271:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner_18">form owner</a>'s <code title="attr-fs-target"><a href="#attr-fs-target" id="target_9">target</a></code>
1.1       mike      272:   attribute, if <em>it</em> has such an attribute; or, if the
1.19      mike      273:   <code><a href="infrastructure.html#document" id="document_65">Document</a></code> contains a <code><a href="the-base-element.html#the-base-element" id="base_12">base</a></code> element with a
1.1       mike      274:   <code title="attr-base-target"><a href="the-base-element.html#attr-base-target" id="target_3">target</a></code> attribute, then the
                    275:   value of the <code title="attr-base-target"><a href="the-base-element.html#attr-base-target" id="target_4">target</a></code> attribute
                    276:   of the first such <code><a href="the-base-element.html#the-base-element" id="base_13">base</a></code> element; or, if there is no such
                    277:   element, the empty string.<hr><p>The <dfn aria-haspopup="true" id="attr-fs-novalidate" role="button" tabindex="0"><code>novalidate</code></dfn>
                    278:   and <dfn aria-haspopup="true" id="attr-fs-formnovalidate" role="button" tabindex="0"><code>formnovalidate</code></dfn>
1.4       mike      279:   content attributes are <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_24" title="boolean attribute">boolean
1.1       mike      280:   attributes</a>. If present, they indicate that the form is not to
                    281:   be validated during submission.<p>The <dfn aria-haspopup="true" id="concept-fs-novalidate" role="button" tabindex="0">no-validate state</dfn> of
                    282:   an element is true if the element is a <a href="forms.html#concept-submit-button" id="concept-submit-button_9" title="concept-submit-button">submit button</a> and the element's
                    283:   <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate" id="formnovalidate_32">formnovalidate</a></code> attribute
                    284:   is present, or if the element's <a href="association-of-controls-and-forms.html#form-owner" id="form-owner_19">form owner</a>'s <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate" id="novalidate_2">novalidate</a></code> attribute is present,
                    285:   and false otherwise.<div class="example">
                    286: 
                    287:    <p>This attribute is useful to include "save" buttons on forms that
                    288:    have validation constraints, to allow users to save their progress
                    289:    even though they haven't fully entered the data in the form. The
                    290:    following example shows a simple form that has two required
                    291:    fields. There are three buttons: one to submit the form, which
                    292:    requires both fields to be filled in; one to save the form so that
                    293:    the user can come back and fill it in later; and one to cancel the
                    294:    form altogether.</p>
                    295: 
                    296:    <pre>&lt;form action="editor.cgi" method="post"&gt;
                    297:  &lt;p&gt;&lt;label&gt;Name: &lt;input required name=fn&gt;&lt;/label&gt;&lt;/p&gt;
                    298:  &lt;p&gt;&lt;label&gt;Essay: &lt;textarea required name=essay&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
                    299:  &lt;p&gt;&lt;input type=submit name=submit value="Submit essay"&gt;&lt;/p&gt;
                    300:  &lt;p&gt;&lt;input type=submit formnovalidate name=save value="Save essay"&gt;&lt;/p&gt;
                    301:  &lt;p&gt;&lt;input type=submit formnovalidate name=cancel value="Cancel"&gt;&lt;/p&gt;
                    302: &lt;/form&gt;</pre>
                    303: 
                    304:   </div>
                    305: <p>The <dfn aria-haspopup="true" id="dom-fs-action" role="button" tabindex="0"><code>action</code></dfn> IDL
1.20      mike      306:   attribute must <a href="common-dom-interfaces.html#reflect" id="reflect_87">reflect</a> the content attribute of the
1.1       mike      307:   same name, except that on getting, when the content attribute is
                    308:   missing or its value is the empty string, <a href="dom.html#the-document-s-address" id="the-document's-address_3">the document's
                    309:   address</a> must be returned instead. The <dfn aria-haspopup="true" id="dom-fs-target" role="button" tabindex="0"><code>target</code></dfn> IDL attribute must
1.20      mike      310:   <a href="common-dom-interfaces.html#reflect" id="reflect_88">reflect</a> the content attribute of the same name. The
1.1       mike      311:   <dfn aria-haspopup="true" id="dom-fs-method" role="button" tabindex="0"><code>method</code></dfn> and <dfn aria-haspopup="true" id="dom-fs-enctype" role="button" tabindex="0"><code>enctype</code></dfn> IDL attributes
1.20      mike      312:   must <a href="common-dom-interfaces.html#reflect" id="reflect_89">reflect</a> the respective content attributes of the
1.1       mike      313:   same name, <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-dom-interfaces.html#limited-to-only-known-values" title='Read about this "limited to only known values" reference in the full HTML5 spec.'>limited to only known values</a>. The <dfn aria-haspopup="true" id="dom-fs-encoding" role="button" tabindex="0"><code>encoding</code></dfn> IDL attribute
1.20      mike      314:   must <a href="common-dom-interfaces.html#reflect" id="reflect_90">reflect</a> the <code title="attr-fs-enctype"><a href="#attr-fs-enctype" id="enctype_4">enctype</a></code> content attribute,
1.1       mike      315:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-dom-interfaces.html#limited-to-only-known-values" title='Read about this "limited to only known values" reference in the full HTML5 spec.'>limited to only known values</a>. The <dfn aria-haspopup="true" id="dom-fs-novalidate" role="button" tabindex="0"><code>noValidate</code></dfn> IDL
                    316:   attribute must reflect the <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate" id="novalidate_3">novalidate</a></code> content attribute. The
                    317:   <dfn aria-haspopup="true" id="dom-fs-formaction" role="button" tabindex="0"><code>formAction</code></dfn> IDL
                    318:   attribute must reflect the <code title="attr-fs-formaction"><a href="#attr-fs-formaction" id="formaction_31">formaction</a></code> content attribute,
                    319:   except that on getting, when the content attribute is missing or its
                    320:   value is the empty string, <a href="dom.html#the-document-s-address" id="the-document's-address_4">the document's address</a> must
                    321:   be returned instead. The <dfn aria-haspopup="true" id="dom-fs-formenctype" role="button" tabindex="0"><code>formEnctype</code></dfn> IDL
                    322:   attribute must reflect the <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype" id="formenctype_31">formenctype</a></code> content attribute,
                    323:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-dom-interfaces.html#limited-to-only-known-values" title='Read about this "limited to only known values" reference in the full HTML5 spec.'>limited to only known values</a>. The <dfn aria-haspopup="true" id="dom-fs-formmethod" role="button" tabindex="0"><code>formMethod</code></dfn> IDL
                    324:   attribute must reflect the <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod" id="formmethod_31">formmethod</a></code> content attribute,
                    325:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-dom-interfaces.html#limited-to-only-known-values" title='Read about this "limited to only known values" reference in the full HTML5 spec.'>limited to only known values</a>. The <dfn aria-haspopup="true" id="dom-fs-formnovalidate" role="button" tabindex="0"><code>formNoValidate</code></dfn> IDL
                    326:   attribute must reflect the <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate" id="formnovalidate_33">formnovalidate</a></code> content
                    327:   attribute. The <dfn aria-haspopup="true" id="dom-fs-formtarget" role="button" tabindex="0"><code>formTarget</code></dfn> IDL
                    328:   attribute must reflect the <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget" id="formtarget_31">formtarget</a></code> content attribute.
                    329: 
                    330:   </p>
                    331: <h5 id="submitting-element-directionality"><span class="secno">4.10.19.6 </span>Submitting element directionality</h5><p>A <dfn aria-haspopup="true" id="form-control-dirname-attribute" role="button" tabindex="0">form control <code title="">dirname</code> attribute</dfn>
1.12      mike      332:   on a form control element enables the submission of <a href="global-attributes.html#the-directionality" id="the-directionality_12">the
1.1       mike      333:   directionality</a> of the element, and gives the name of the
                    334:   field that contains this value during <a href="form-submission.html#form-submission" id="form-submission_1">form submission</a>.
                    335:   If such an attribute is specified, its value must not be the empty
                    336:   string.

Webmaster