# Bad value X for attribute “autocomplete” on element “input”: The string Y is not a valid autofill field name.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-autocomplete-on-element-input-the-string-y-is-not-a-valid-autofill-field-name
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `autocomplete` attribute of an `<input>` contains a word that isn't one of the autofill field names defined in the HTML standard.

`autocomplete` doesn't take free text. It takes `on`, `off`, or tokens from a fixed list such as `name`, `email`, `organization`, `postal-code` or `tel`, optionally preceded by a `section-*` name and by `shipping` or `billing`. Browsers and password managers read those tokens to fill the field with data the user has saved. A word outside the list gives them no hint about what the field holds.

This usually happens when the field's own name ends up in `autocomplete`, often in the language of the page, such as `unidade-saude` on a Portuguese form. Autofill field names are fixed English tokens, whatever the language of the page. When the value has several tokens, the message quotes only the one the validator doesn't recognize.

If one of the standard tokens describes the field, use it. If none does, as with a clinic or department name, set `autocomplete="off"` or remove the attribute, and keep your own identifier in `name` or `id`.

## Invalid example

```html
<label for="clinic">Clinic</label>
<input type="text" id="clinic" name="clinic" autocomplete="clinic-name">
```

## Valid example

```html
<label for="clinic">Clinic</label>
<input type="text" id="clinic" name="clinic" autocomplete="off">
```

When a standard token fits the field, use it:

```html
<label for="company">Company</label>
<input type="text" id="company" name="company" autocomplete="organization">
```
