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

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-false-for-attribute-autocomplete-on-element-textarea-the-string-false-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 isn't a true/false switch: to turn autofill off on a `<textarea>`, write `autocomplete="off"`, not `autocomplete="false"`.

On a `<textarea>`, as on `<input>` and `<select>`, `autocomplete` takes either `on` or `off`, or autofill field names such as `street-address` that tell the browser what data the field expects. `true` and `false` belong to other attributes, like `spellcheck` and `contenteditable`, and the validator rejects `autocomplete="true"` too.

An invalid value doesn't fail safe. The HTML standard treats a value it can't parse as if the attribute weren't there, so the `<textarea>` falls back to its form's `autocomplete` setting. Unless the form says `off`, autofill stays on, which is the opposite of what `false` was meant to do.

With `autocomplete="off"`, the browser should not save what the user types in the field or suggest values typed before. Browsers treat it as a request. The standard lets them allow users to override it, and most browsers ignore `off` on login fields so password managers keep working. On an ordinary message field, removing the attribute is also a valid fix.

If the goal was to stop the red underlines or the automatic corrections, those have their own attributes. `spellcheck="false"` turns off spelling and grammar checking, and `autocorrect="off"` tells the browser not to correct words as the user types. Watch the values: `spellcheck` takes `true` and `false`, but `autocorrect` takes `on` and `off` like `autocomplete`, so `autocorrect="false"` is also an error.

## Invalid example

```html
<form action="/contact" method="post">
  <label for="message">Message</label>
  <textarea id="message" name="message" rows="6" autocomplete="false"></textarea>
  <button type="submit">Send</button>
</form>
```

## Valid example

```html
<form action="/contact" method="post">
  <label for="message">Message</label>
  <textarea id="message" name="message" rows="6" autocomplete="off"></textarea>
  <button type="submit">Send</button>
</form>
```

To turn off spell checking and autocorrection instead:

```html
<label for="snippet">Code snippet</label>
<textarea id="snippet" name="snippet" rows="6" spellcheck="false" autocorrect="off"></textarea>
```
