logo

Input Autocomplete Issues

Mar 2, 2025 · 3min

To trigger autofill, there is one prerequisite:

  1. There needs to be an input element with type="password".

When you want to disable autofill,

add autocomplete="new-password" to the input element.

However, this only stops it from filling in the field initially.

The browser will still remember values and show them as suggestions in a popup.

Form with autofill

<form>
  <input
    type="email"
    required
    name="email"
    placeholder="email"
  />
  <input
    type="password"
    required
    name="password"
    placeholder="password"
  />
  <button
    type="submit"
  >
    Login
  </button>
</form>

Form without autofill

<form>
  <input
    type="email"
    required
    name="email"
    placeholder="email"
  />
  <input
    type="password"
    required
    name="password"
    autocomplete="new-password"
    placeholder="password"
  />
  <button
    type="submit"
  >
    Login
  </button>
</form>

References

How to turn off form autocompletion

© Cloud