autocomplete attribute is available on
<input> elements that take a text or numeric value as input,
<select> elements, and
autocomplete lets web developers specify what if any permission the user agent has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.
The source of the suggested values is generally up to the browser; typically values come from past values entered by the user, but they may also come from pre-configured values. For instance, a browser might let the user save their name, address, phone number, and email addresses for autocomplete purposes. Perhaps the browser offers the ability to save encrypted credit card information, for autocompletion following an authentication procedure.
<textarea> element has no
autocomplete attribute, then browsers use the
autocomplete attribute of the element's form owner, which is either the
<form> element that the element is a descendant of, or the
id is specified by the
form attribute of the element.
In order to provide autocompletion, user-agents might require
<textarea> elements to:
off" will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form. See the autocomplete attribute and login fields.
name" rather than breaking the name down into its components is generally preferred because it avoids dealing with the wide diversity of human names and how they are structured; however, you can use the following
autocompletevalues if you do need to break the name down into its components:
street-address" is not present.
transaction-currency", of the transaction, for a payment form.
tel-local-prefix" for "555" and "
tel-local-suffix" for "6502".
See the WHATWG Standard for more detailed information.
autocomplete attribute also controls whether Firefox will — unlike other browsers — persist the dynamic disabled state and (if applicable) dynamic checkedness of an
<textarea> element, or entire
<form> across page loads. The persistence feature is enabled by default. Setting the value of the
autocomplete attribute to
off disables this feature. This works even when the
autocomplete attribute would normally not apply by virtue of its
type. See bug 654072.
<div> <label for="cc-number">Enter your credit card number</label> <input name="cc-number" id="cc-number" autocomplete="off"> </div>
The four administrative level fields (
address-level4) describe the address in terms of increasing levels of precision within the country in which the address is located. Each country has its own system of administrative levels, and may arrange the levels in different orders when addresses are written.
address-level1 always represents the broadest administrative division; it is the least-specific portion of the address short of the country name.
Given that different countries write their address in different ways, with each field in different places within the address, and even different sets and numbers of fields entirely, it can be helpful if, when possible, your site is able to switch to the layout expected by your users when presenting an address entry form, given the country the address is located within.
The way each administrative level is used will vary from country to country. Below are some examples; this is not meant to be an exhaustive list.
A typical home address within the United States looks like this:
432 Anywhere St
Exampleville CA 95555
In the United States, the least-specific portion of the address is the state, in this case "CA" (the official US Postal Service shorthand for "California"). Thus
address-level1 is the state, or "CA" in this case.
The second-least specific portion of the address is the city or town name, so
address-level2 is "Exampleville" in this example address.
United States addresses do not use levels 3 and up.
Address input forms in the UK should contain one address level and one, two or three address lines, depending on the address. A complete address would look like so:
103 Frogmarch Street
The address levels are:
address-level1: The post town — "Winchelsea" in this case.
address-line2: The locality — "Upper-Wapping" in this case.
address-line1: The house/street particulars — "103 Frogmarch Street"
The postcode is separate. Note that you can actually use just the postcode and
address-line1 to sucessfully deliver mail in the UK, so they should be the only mandatory items, but usually people tend to provide more details.
China can use as many as three administrative levels: the province, the city, and the district.
The 6 digit postal code is not always needed but when supplied it is placed separately with a label for clarity. For example:
An address in Japan is typically written in one line, in an order from the least-specific to more-specific portions (in reverse order to the United States). There are two or three administrative levels in an address. Additional line can be used to show building names and room numbers. The postal code is separate. For example:
"〒" and following seven digits shows the postal code.
address-level1 is used for prefectures or the Tokyo Metropolis; "長野県" (Nagano Prefecture) is in this case.
address-level2 is typically used for cities, counties, towns and villages; "長野市" (Nagano City) in this case. "某町123" is
address-line1 which consists of an area name and a lot number.
|HTML Living Standard||Living Standard|
© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.