Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML autocorrect attribute #35692

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions files/en-us/web/html/element/input/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,10 @@ The following non-standard attributes are also available on some browsers. As a
</tr>
</thead>
<tbody>
<tr>
<td><a href="#autocorrect"><code>autocorrect</code></a></td>
<td>
A string indicating whether autocorrect is <code>on</code> or <code>off</code>. <strong>Safari only.</strong>
</td>
</tr>
<tr>
<td><a href="#incremental"><code>incremental</code></a></td>
<td>
Whether or not to send repeated {{domxref("HTMLInputElement/search_event", "search")}}
events to allow updating live search results while the user is still editing the value of the field.
Whether or not to send repeated {{domxref("HTMLInputElement/search_event", "search")}} events to allow updating live search results while the user is still editing the value of the field.
<strong>WebKit and Blink only (Safari, Chrome, Opera, etc.).</strong>
</td>
</tr>
Expand Down Expand Up @@ -685,15 +678,6 @@ The following non-standard attributes are also available on some browsers. As a
</tbody>
</table>

- `autocorrect` {{non-standard_inline}}

- : (Safari only). A string which indicates whether to activate automatic correction while the user is editing this field. Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

- `incremental` {{non-standard_inline}}

- : The Boolean attribute `incremental` is a WebKit and Blink extension (so supported by Safari, Opera, Chrome, etc.) which, if present, tells the {{Glossary("user agent")}} to process the input as a live search. As the user edits the value of the field, the user agent sends {{domxref("HTMLInputElement/search_event", "search")}} events to the {{domxref("HTMLInputElement")}} object representing the search box. This allows your code to update the search results in real time as the user edits the search.
Expand Down
11 changes: 6 additions & 5 deletions files/en-us/web/html/element/input/search/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,20 @@ An input field can have spell-checking enabled if it doesn't have the [readonly]

The value returned by reading `spellcheck` may not reflect the actual state of spell-checking within a control, if the {{Glossary("user agent", "user agent's")}} preferences override the setting.

## Non-standard attributes

The following non-standard attributes are available to search input fields. As a general rule, you should avoid using them unless it can't be helped.

### autocorrect

A Safari extension, the `autocorrect` attribute is a string which indicates whether to activate automatic correction while the user is editing this field. Permitted values are:
[`autocorrect`](/en-US/docs/Web/HTML/Global_attributes#autocorrect) is a global attribute that is used to indicate whether to activate automatic spelling correction while the user is editing this field.
Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

## Non-standard attributes

The following non-standard attributes are available to search input fields. As a general rule, you should avoid using them unless it can't be helped.

### incremental

The Boolean attribute `incremental` is a WebKit and Blink extension (so supported by Safari, Opera, Chrome, etc.) which, if present, tells the {{Glossary("user agent")}} to process the input as a live search. As the user edits the value of the field, the user agent sends {{domxref("HTMLInputElement/search_event", "search")}} events to the {{domxref("HTMLInputElement")}} object representing the search box. This allows your code to update the search results in real time as the user edits the search.
Expand Down
19 changes: 10 additions & 9 deletions files/en-us/web/html/element/input/tel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ The {{HTMLElement("input")}} element's [`value`](/en-US/docs/Web/HTML/Element/in

In addition to the attributes that operate on all {{HTMLElement("input")}} elements regardless of their type, telephone number inputs support the following attributes.

### autocorrect

The [`autocorrect`](/en-US/docs/Web/HTML/Global_attributes#autocorrect) global attribute is used to indicate whether to activate automatic spelling correction while the user is editing this field.
Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

### list

The values of the list attribute is the {{domxref("Element.id", "id")}} of a {{HTMLElement("datalist")}} element located in the same document. The {{HTMLElement("datalist")}} provides a list of predefined values to suggest to the user for this input. Any values in the list that are not compatible with the [`type`](/en-US/docs/Web/HTML/Element/input#type) are not included in the suggested options. The values provided are suggestions, not requirements: users can select from this predefined list or provide a different value.
Expand Down Expand Up @@ -77,15 +87,6 @@ This does _not_ set a limit on how many characters the user can enter into the f

The following non-standard attributes are available to telephone number input fields. As a general rule, you should avoid using them unless it can't be helped.

### autocorrect

A Safari extension, the `autocorrect` attribute is a string which indicates whether to activate automatic correction while the user is editing this field. Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

## Using tel inputs

Telephone numbers are a very commonly collected type of data on the web. When creating any kind of registration or e-commerce site, for example, you will likely need to ask the user for a telephone number, whether for business purposes or for emergency contact purposes. Given how commonly-entered phone numbers are, it's unfortunate that a "one size fits all" solution for validating phone numbers is not practical.
Expand Down
19 changes: 10 additions & 9 deletions files/en-us/web/html/element/input/text/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ If no validation constraints are in place for the input (see [Validation](#valid

In addition to the attributes that operate on all {{HTMLElement("input")}} elements regardless of their type, text inputs support the following attributes.

### autocorrect

The [`autocorrect`](/en-US/docs/Web/HTML/Global_attributes/autocorrect) global attribute is a string that indicates whether to activate automatic correction while the user is editing this field.
Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

### `list`

The values of the list attribute is the {{domxref("Element.id", "id")}} of a {{HTMLElement("datalist")}} element located in the same document. The {{HTMLElement("datalist")}} provides a list of predefined values to suggest to the user for this input. Any values in the list that are not compatible with the [`type`](/en-US/docs/Web/HTML/Element/input#type) are not included in the suggested options. The values provided are suggestions, not requirements: users can select from this predefined list or provide a different value.
Expand Down Expand Up @@ -93,15 +103,6 @@ The value returned by reading `spellcheck` may not reflect the actual state of s

The following non-standard attributes are also available on some browsers. As a general rule, you should avoid using them unless it can't be helped.

### `autocorrect`

A Safari extension, the `autocorrect` attribute is a string that indicates whether to activate automatic correction while the user is editing this field. Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

## Using text inputs

`<input>` elements of type `text` create basic, single-line inputs. You should use them anywhere you want the user to enter a single-line value and there isn't a more specific input type available for collecting that value (for example, if it's a [date](/en-US/docs/Web/HTML/Element/input/datetime-local), [URL](/en-US/docs/Web/HTML/Element/input/url), [email](/en-US/docs/Web/HTML/Element/input/email), or [search term](/en-US/docs/Web/HTML/Element/input/search), you've got better options available).
Expand Down
13 changes: 0 additions & 13 deletions files/en-us/web/html/element/input/url/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,6 @@ An input field can have spell-checking enabled if it doesn't have the [readonly]

The value returned by reading `spellcheck` may not reflect the actual state of spell-checking within a control if the {{Glossary("user agent", "user agent's")}} preferences override the setting.

## Non-standard attributes

The following non-standard attributes are also available on some browsers. As a general rule, you should avoid using them unless it can't be helped.

### autocorrect

A Safari extension, the `autocorrect` attribute is a string that indicates whether to activate automatic correction while the user is editing this field. Permitted values are:

- `on`
- : Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
- `off`
- : Disable automatic correction and text substitutions.

## Using URL inputs

When you create a URL input with the proper `type` value, `url`, you get automatic validation that the entered text is at least in the correct form to potentially be a legitimate URL. This can help avoid cases in which the user mistypes their website's address, or provides an invalid one.
Expand Down
13 changes: 7 additions & 6 deletions files/en-us/web/html/element/textarea/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,30 @@ The `<textarea>` element also accepts several attributes common to form `<input>

This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attributes).

- `autocapitalize`
- [`autocapitalize`](/en-US/docs/Web/HTML/Global_attributes/autocapitalize)

- : Controls whether inputted text is automatically capitalized and, if so, in what manner. See the [`autocapitalize`](/en-US/docs/Web/HTML/Global_attributes/autocapitalize) global attribute page for more information.
- : A string that indicates whether input text is automatically capitalized and, if so, in what manner.

- [`autocomplete`](/en-US/docs/Web/HTML/Attributes/autocomplete)

- : This attribute indicates whether the value of the control can be automatically completed by the browser. Possible values are:
- : A string that indicates whether the value of the control can be automatically completed by the browser. Possible values are:

- `off`: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.
- `on`: The browser can automatically complete the value based on values that the user has entered during previous uses.

If the `autocomplete` attribute is not specified on a `<textarea>` element, then the browser uses the `autocomplete` attribute value of the `<textarea>` element's form owner. The form owner is either the {{HTMLElement("form")}} element that this `<textarea>` element is a descendant of or the form element whose `id` is specified by the `form` attribute of the input element. For more information, see the [`autocomplete`](/en-US/docs/Web/HTML/Element/form#autocomplete) attribute in {{HTMLElement("form")}}.

- `autocorrect` {{non-standard_inline}}
- [`autocorrect`](/en-US/docs/Web/HTML/Global_attributes/autocorrect)

- : A string which indicates whether to activate automatic spelling correction and processing of text substitutions (if any are configured) while the user is editing this `textarea`. Permitted values are:
- : A string that indicates whether to activate automatic spelling correction and processing of text while the user is editing this `textarea`.
Permitted values are:

- `on`
- : Enable automatic spelling correction and text substitutions.
- `off`
- : Disable automatic spelling correction and text substitutions.

- `autofocus`
- [`autofocus`](/en-US/docs/Web/HTML/Global_attributes/autofocus)
- : This Boolean attribute lets you specify that a form control should have input focus when the page loads. Only one form-associated element in a document can have this attribute specified.
- `cols`
- : The visible width of the text control, in average character widths. If it is specified, it must be a positive integer. If it is not specified, the default value is `20`.
Expand Down
Loading