You are here: Reference > HTML > attributes > autoComplete (form, input)

autoComplete attribute (form, input)

Browser support:
Sets whether the text field should give the user some suggestion during typing.
When the Autocomplete is enabled, suggestions can be visible for the value of the text field. The suggestions are stored on the local machine when the user submits the form, based on the value of the name or vCard_name (Internet Explorer only) attribute of the element.
You can set the default state of auto completion in a form with the autoComplete attribute of the form tag. This setting affects all input:password and input:text elements on the form, but can be overridden with the autoComplete attribute of these tags.
The user can disable Autocomplete windows in Internet Explorer (Tools / Internet Options / Content / Autocomplete - Settings).
The autoComplete attribute has effect only if the use of Autocomplete windows is enabled in the browser.
JavaScript page for this attribute: autocomplete. You can find other example(s) there.

Possible values:

String that sets the state of autocompletion.
One of the following values:
AutoComplete is disabled.
AutoComplete is enabled.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the autoComplete attribute. The default Autocomplete settings need to be changed for this example in Internet Explorer 8 (Tools / Internet Options / Content / Autocomplete - Settings / enable Forms):
Fill the user name and city fields with some text content, and submit the form.<br />
After that, start to fill these fields with the same content. An autocomplete window will displayed for to the user name field.
<br /><br />
<form method="post">
    User name, with autocompletion:
    <input type="text" name="username" autocomplete="on" />
    <br />
    City, without autocompletion:
    <input type="text" name="city" autocomplete="off" />
    <br /><br />
    <input type="submit" value="Send" />
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content