Skip to content

How to enable user and password autocomplete suggestions

Published:

The HTML autocomplete provides automated assistance in filling out form field values. To ensure your HTML input element displays the right autofill suggestion, you need to set the right attribute for an input/select/textarea element.

It is also useful to indicate to the password managers installed on the browser which are the username and password fields, even when they are in different forms or pages.

These are some examples:

Login form

<input id="username-id" type="email" autocomplete="username"/>
<input id="pass-id" type="password" autocomplete="current-password"/>

Change Password form

<input id="old-pass-id" type="password" autocomplete="current-password"/>
<input id="new-pass-id" type="password" autocomplete="new-password"/>
<input id="confirm-new-pass-id" type="password" autocomplete="new-password"/>

Useful autocomplete values