Disabling Autocomplete in HTML Forms

Browsers are so smart they are trying to fill forms for you. And sometimes this is bad.

Html5 provides an attribute autocomplete="on|off" to prefent browsers filling fields for you. And you should add autocomplete="off" to inputs in cases like these:

  • "Set password", "Change password" and "Retype password" fields.
  • Captcha field.
  • Credit card number.

Sometimes you need to do it for security reasons. Sometimes it just makes your forms more comfortable.

Tags: , , ,