diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/element%2Fform.html | |
new repository
Diffstat (limited to 'devdocs/html/element%2Fform.html')
| -rw-r--r-- | devdocs/html/element%2Fform.html | 292 |
1 files changed, 292 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fform.html b/devdocs/html/element%2Fform.html new file mode 100644 index 00000000..73813bd6 --- /dev/null +++ b/devdocs/html/element%2Fform.html @@ -0,0 +1,292 @@ +<header><h1><form>: The Form element</h1></header><div class="section-content"><p>The <code><form></code> <a href="../index">HTML</a> element represents a document section containing interactive controls for submitting information.</p></div> +<h2 id="try_it">Try it</h2> +<div class="section-content"> +<iframe class="interactive is-tabbed-standard-height" height="200" src="https://interactive-examples.mdn.mozilla.net/pages/tabbed/form.html" title="MDN Web Docs Interactive Example" loading="lazy"></iframe> <p>It is possible to use the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:valid"><code>:valid</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid"><code>:invalid</code></a> CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes">pseudo-classes</a> to style a <code><form></code> element based on whether the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements"><code>elements</code></a> inside the form are valid.</p> +</div> +<h2 id="attributes">Attributes</h2> +<div class="section-content"> +<p>This element includes the <a href="../global_attributes">global attributes</a>.</p> <dl> <dt id="accept"> +<a href="#accept"><code>accept</code></a> <abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr> +</dt> <dd> <p>Comma-separated <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type">content types</a> the server accepts.</p> <div class="notecard note" id="sect1"> <p><strong>Note:</strong> <strong>This attribute has been deprecated and should not be used.</strong> Instead, use the <a href="input#accept"><code>accept</code></a> attribute on <code><input type=file></code> elements.</p> </div> </dd> <dt id="accept-charset"><a href="#accept-charset"><code>accept-charset</code></a></dt> <dd> <p> Space-separated <a href="https://developer.mozilla.org/en-US/docs/Glossary/Character_encoding">character encodings</a> the server accepts. The browser uses them in the order in which they are listed. The default value means <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">the same encoding as the page</a>. (In previous versions of HTML, character encodings could also be delimited by commas.) </p> </dd> <dt id="autocapitalize"> +<a href="#autocapitalize"><code>autocapitalize</code></a> <abbr class="icon icon-nonstandard" title="Non-standard. Check cross-browser support before using."> <span class="visually-hidden">Non-standard</span> </abbr> +</dt> <dd> <p>A nonstandard attribute used by iOS Safari that controls how textual form elements should be automatically capitalized. <code>autocapitalize</code> attributes on a form elements override it on <code><form></code>. Possible values:</p> <ul> <li> +<code>none</code>: No automatic capitalization.</li> <li> +<code>sentences</code> (default): Capitalize the first letter of each sentence.</li> <li> +<code>words</code>: Capitalize the first letter of each word.</li> <li> +<code>characters</code>: Capitalize all characters — that is, uppercase.</li> </ul> </dd> <dt id="autocomplete"><a href="#autocomplete"><code>autocomplete</code></a></dt> <dd> <p>Indicates whether input elements can by default have their values automatically completed by the browser. <code>autocomplete</code> attributes on form elements override it on <code><form></code>. Possible values:</p> <ul> <li> +<code>off</code>: The browser may not automatically complete entries. (Browsers tend to ignore this for suspected login forms; see <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#the_autocomplete_attribute_and_login_fields">The autocomplete attribute and login fields</a>.)</li> <li> +<code>on</code>: The browser may automatically complete entries.</li> </ul> </dd> <dt id="name"><a href="#name"><code>name</code></a></dt> <dd> <p>The name of the form. The value must not be the empty string, and must be unique among the <code>form</code> elements in the forms collection that it is in, if any.</p> </dd> <dt id="rel"><a href="#rel"><code>rel</code></a></dt> <dd> <p>Controls the annotations and what kinds of links the form creates. Annotations include <a href="../attributes/rel#external"><code>external</code></a>, <a href="../attributes/rel#nofollow"><code>nofollow</code></a>, <a href="../attributes/rel#opener"><code>opener</code></a>, <a href="../attributes/rel#noopener"><code>noopener</code></a>, and <a href="../attributes/rel#noreferrer"><code>noreferrer</code></a>. Link types include <a href="../attributes/rel#help"><code>help</code></a>, <a href="../attributes/rel#prev"><code>prev</code></a>, <a href="../attributes/rel#next"><code>next</code></a>, <a href="../attributes/rel#search"><code>search</code></a>, and <a href="../attributes/rel#license"><code>license</code></a>. The <a href="../attributes/rel"><code>rel</code></a> value is a space-separated list of these enumerated values.</p> </dd> </dl> +</div> +<h3 id="attributes_for_form_submission">Attributes for form submission</h3> +<div class="section-content"> +<p>The following attributes control behavior during form submission.</p> <dl> <dt id="action"><a href="#action"><code>action</code></a></dt> <dd> <p>The URL that processes the form submission. This value can be overridden by a <a href="button#formaction"><code>formaction</code></a> attribute on a <a href="button"><code><button></code></a>, <a href="input/submit"><code><input type="submit"></code></a>, or <a href="input/image"><code><input type="image"></code></a> element. This attribute is ignored when <code>method="dialog"</code> is set.</p> </dd> <dt id="enctype"><a href="#enctype"><code>enctype</code></a></dt> <dd> <p>If the value of the <code>method</code> attribute is <code>post</code>, <code>enctype</code> is the <a href="https://en.wikipedia.org/wiki/Mime_type" target="_blank">MIME type</a> of the form submission. Possible values:</p> <ul> <li> +<code>application/x-www-form-urlencoded</code>: The default value.</li> <li> +<code>multipart/form-data</code>: Use this if the form contains <a href="input"><code><input></code></a> elements with <code>type=file</code>.</li> <li> +<code>text/plain</code>: Useful for debugging purposes.</li> </ul> <p>This value can be overridden by <a href="button#formenctype"><code>formenctype</code></a> attributes on <a href="button"><code><button></code></a>, <a href="input/submit"><code><input type="submit"></code></a>, or <a href="input/image"><code><input type="image"></code></a> elements.</p> </dd> <dt id="method"><a href="#method"><code>method</code></a></dt> <dd> <p> The <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP">HTTP</a> method to submit the form with. The only allowed methods/values are (case insensitive): </p> <ul> <li> +<code>post</code>: The <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST"><code>POST</code></a> method; form data sent as the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Request/body">request body</a>.</li> <li> +<code>get</code> (default): The <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET"><code>GET</code></a>; form data appended to the <code>action</code> URL with a <code>?</code> separator. Use this method when the form <a href="https://developer.mozilla.org/en-US/docs/Glossary/Idempotent">has no side effects</a>.</li> <li> +<code>dialog</code>: When the form is inside a <a href="dialog"><code><dialog></code></a>, closes the dialog and causes a <code>submit</code> event to be fired on submission, without submitting data or clearing the form.</li> </ul> <p>This value is overridden by <a href="button#formmethod"><code>formmethod</code></a> attributes on <a href="button"><code><button></code></a>, <a href="input/submit"><code><input type="submit"></code></a>, or <a href="input/image"><code><input type="image"></code></a> elements.</p> </dd> <dt id="novalidate"><a href="#novalidate"><code>novalidate</code></a></dt> <dd> <p>This Boolean attribute indicates that the form shouldn't be validated when submitted. If this attribute is not set (and therefore the form <strong><em>is</em></strong> validated), it can be overridden by a <a href="button#formnovalidate"><code>formnovalidate</code></a> attribute on a <a href="button"><code><button></code></a>, <a href="input/submit"><code><input type="submit"></code></a>, or <a href="input/image"><code><input type="image"></code></a> element belonging to the form.</p> </dd> <dt id="target"><a href="#target"><code>target</code></a></dt> <dd> <p>Indicates where to display the response after submitting the form. It is a name/keyword for a <em>browsing context</em> (for example, tab, window, or iframe). The following keywords have special meanings:</p> <ul> <li> +<code>_self</code> (default): Load into the same browsing context as the current one.</li> <li> +<code>_blank</code>: Load into a new unnamed browsing context. This provides the same behavior as setting <a href="#rel"><code>rel="noopener"</code></a> which does not set <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/opener"><code>window.opener</code></a>.</li> <li> +<code>_parent</code>: Load into the parent browsing context of the current one. If no parent, behaves the same as <code>_self</code>.</li> <li> +<code>_top</code>: Load into the top-level browsing context (i.e., the browsing context that is an ancestor of the current one and has no parent). If no parent, behaves the same as <code>_self</code>.</li> </ul> <p>This value can be overridden by a <a href="button#formtarget"><code>formtarget</code></a> attribute on a <a href="button"><code><button></code></a>, <a href="input/submit"><code><input type="submit"></code></a>, or <a href="input/image"><code><input type="image"></code></a> element.</p> </dd> </dl> +</div> +<h2 id="examples">Examples</h2> +<div class="section-content"><div class="code-example"> +<p class="example-header"><span class="language-name">html</span></p> +<pre data-signature="sgoC2PpCpEoHvF8uA7Pgbk3UfBmveJzLc6BlFK7Dqzo=" data-language="html"><span class="token comment"><!-- Form which will send a GET request to the current URL --></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>form</span> <span class="token attr-name">method</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>get<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>label</span><span class="token punctuation">></span></span> + Name: + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>input</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>submitted-name<span class="token punctuation">"</span></span> <span class="token attr-name">autocomplete</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>name<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>label</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>button</span><span class="token punctuation">></span></span>Save<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>button</span><span class="token punctuation">></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>form</span><span class="token punctuation">></span></span> + +<span class="token comment"><!-- Form which will send a POST request to the current URL --></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>form</span> <span class="token attr-name">method</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>post<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>label</span><span class="token punctuation">></span></span> + Name: + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>input</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>submitted-name<span class="token punctuation">"</span></span> <span class="token attr-name">autocomplete</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>name<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>label</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>button</span><span class="token punctuation">></span></span>Save<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>button</span><span class="token punctuation">></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>form</span><span class="token punctuation">></span></span> + +<span class="token comment"><!-- Form with fieldset, legend, and label --></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>form</span> <span class="token attr-name">method</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>post<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>fieldset</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>legend</span><span class="token punctuation">></span></span>Do you agree to the terms?<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>legend</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>label</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>yes<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> Yes<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>label</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>label</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> No<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>label</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>fieldset</span><span class="token punctuation">></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>form</span><span class="token punctuation">></span></span> +</pre> +</div></div> +<h3 id="result">Result</h3> +<div class="section-content"><div class="code-example" id="sect2"> + +<iframe class="sample-code-frame" title="Examples sample" id="frame_examples" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/form/runner.html?id=examples" loading="lazy"></iframe> +</div></div> +<h2 id="technical_summary">Technical summary</h2> +<div class="section-content"><figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td> <a href="../content_categories#flow_content">Flow content</a>, <a href="../content_categories#palpable_content">palpable content</a> </td> </tr> <tr> <th scope="row">Permitted content</th> <td> +<a href="../content_categories#flow_content">Flow content</a>, but not containing <code><form></code> elements</td> </tr> <tr> <th scope="row">Tag omission</th> <td>None, both the starting and ending tag are mandatory.</td> </tr> <tr> <th scope="row">Permitted parents</th> <td> Any element that accepts <a href="../content_categories#flow_content">flow content</a> </td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><code><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/form_role">form</a></code></td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td> <code><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/search_role">search</a></code>, <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/none_role"><code>none</code></a> or <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role"><code>presentation</code></a> </td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement"><code>HTMLFormElement</code></a></td> </tr> </tbody> </table></div></figure></div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/forms.html#the-form-element">HTML Standard <br><small># the-form-element</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody> +<tr> +<th><code>form</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">≤4</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">≤3.2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>accept</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>accept-charset</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>action</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">≤4</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">≤3.2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>autocapitalize</code></th> +<td class="bc-supports-yes">43</td> +<td class="bc-supports-yes">79</td> +<td class="bc-supports-yes">111</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">30</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">43</td> +<td class="bc-supports-yes">43</td> +<td class="bc-supports-yes">111</td> +<td class="bc-supports-yes">30</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">4.0</td> +</tr> +<tr> +<th><code>autocomplete</code></th> +<td class="bc-supports-yes"><details><summary>14</summary>The Google Chrome UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Chrome might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes"><details><summary>15</summary>The Opera UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Opera might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +<td class="bc-supports-yes">6</td> +<td class="bc-supports-yes"><details><summary>4.4</summary>The Google Chrome UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Chrome might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +<td class="bc-supports-yes"><details><summary>18</summary>The Google Chrome UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Chrome might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes"><details><summary>14</summary>The Opera UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Opera might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +<td class="bc-supports-yes">6</td> +<td class="bc-supports-yes"><details><summary>1.0</summary>The Samsung Internet UI for auto-complete request varies, depending on whether <code>autocomplete</code> is set to <code>off</code> on <code><input></code> elements as well as their form. Specifically, when a form has <code>autocomplete</code> set to <code>off</code> and its <code><input></code> element's <code>autocomplete</code> attribute is not set, then if the user asks for autofill suggestions for the <code><input></code> element, Samsung Internet might display a message saying 'autocomplete has been disabled for this form.' On the other hand, if both the form and the input element have <code>autocomplete</code> set to <code>off</code>, the browser will not display that message. For this reason, you should set <code>autocomplete</code> to <code>off</code> for each <code><input></code> that has custom auto-completion.</details></td> +</tr> +<tr> +<th><code>enctype</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>method</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>name</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>novalidate</code></th> +<td class="bc-supports-yes">10</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">10</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">10.1</td> +<td class="bc-supports-yes">37</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">10.3</td> +<td class="bc-supports-yes">1.0</td> +</tr> +<tr> +<th><code>rel</code></th> +<td class="bc-supports-yes">108</td> +<td class="bc-supports-yes">108</td> +<td class="bc-supports-yes">111</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">94</td> +<td class="bc-supports-yes">15.4</td> +<td class="bc-supports-yes">108</td> +<td class="bc-supports-yes">108</td> +<td class="bc-supports-yes">111</td> +<td class="bc-supports-yes">73</td> +<td class="bc-supports-yes">15.4</td> +<td class="bc-supports-yes">21.0</td> +</tr> +<tr> +<th><code>target</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">3</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">2</td> +<td class="bc-supports-yes">1.0</td> +</tr> +</tbody> +</table></div> +<h2 id="see_also">See also</h2> +<div class="section-content"><ul> <li><a href="https://developer.mozilla.org/en-US/docs/Learn/Forms">HTML forms guide</a></li> <li>Other elements that are used when creating forms: <a href="button"><code><button></code></a>, <a href="datalist"><code><datalist></code></a>, <a href="fieldset"><code><fieldset></code></a>, <a href="input"><code><input></code></a>, <a href="label"><code><label></code></a>, <a href="legend"><code><legend></code></a>, <a href="meter"><code><meter></code></a>, <a href="optgroup"><code><optgroup></code></a>, <a href="option"><code><option></code></a>, <a href="output"><code><output></code></a>, <a href="progress"><code><progress></code></a>, <a href="select"><code><select></code></a>, <a href="textarea"><code><textarea></code></a>.</li> <li>Getting a list of the elements in the form: <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements"><code>HTMLFormElement.elements</code></a> +</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/form_role">ARIA: Form role</a></li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/search_role">ARIA: Search role</a></li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form</a> + </p> +</div> |
