FSM Full Stack Masterclass
Platform under construction
HTML course badge

HTML Forms

Intermediate

Autocomplete

Learn Autocomplete with practical examples for form structure, input behavior, validation, autocomplete, accessibility, backend safety and live practice.

HTML forms

Autocomplete helps browsers fill known information accurately and safely.

The autocomplete attribute tells the browser what kind of information a field expects. That can make forms faster, especially on mobile.

Good autocomplete values help with names, email, phone numbers, addresses, usernames, current passwords and new passwords.

Autocomplete is not decoration. It is a real usability feature that reduces typing, mistakes and friction.

autocomplete

A hint that identifies the expected data type.

email

Lets browsers fill the user email address.

tel

Lets browsers fill phone information.

new-password

Helps password managers generate and store new passwords.

Syntax and behavior

Use specific autocomplete tokens instead of vague browser guessing.

The best value depends on the field purpose. A login password and a signup password should not use the same token.

Useful autocomplete hints

<label for="full-name">Full name</label>
<input id="full-name" name="name" autocomplete="name">

<label for="email">Email</label>
<input id="email" name="email" type="email" autocomplete="email">

<label for="password">Choose password</label>
<input id="password" name="password" type="password" autocomplete="new-password">

Autocomplete disabled everywhere

<form autocomplete="off">
  <input name="email" type="email">
  <input name="password" type="password">
</form>

Rules that matter

Forms should guide users clearly and protect the backend carefully.

Strong form markup is readable, accessible, secure by design and easy to connect to real server-side validation.

Use name for full names

Autocomplete can fill names more accurately with the right token.

Use email for email fields

Do not make browsers guess from placeholders.

Use current-password for login

This helps password managers fill existing credentials.

Use new-password for signup

This helps password managers generate and save new credentials.

Do not disable without reason

Turning autocomplete off often hurts users.

Use address tokens carefully

Address forms can use street-address, postal-code, address-level2 and more.

Production thinking

Forms connect frontend quality with backend responsibility.

Why does this matter?

This matters because the easiest form is often the one the user does not have to type from scratch.

Accessibility

Autocomplete can reduce cognitive load and typing effort for many users.

Production note

Use correct tokens on login, signup and checkout forms. Password-manager compatibility is part of production quality.

SEO note

Autocomplete does not directly affect ranking, but it improves task completion and trust on conversion pages.

Live code lab

Change the code and run the example.

Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.

Mini assignment

Try this now.

  • Add autocomplete="postal-code" to a postal code field.
  • Add autocomplete="current-password" to a login password field.
  • Explain why autocomplete="off" should not be the default choice.

Practice assignment

Do this before moving to the next lesson.

  1. Create a signup form with name, email and password fields.
  2. Choose the correct autocomplete token for each field.
  3. Write one sentence explaining how this helps mobile users.

Try it yourself

Add useful autocomplete

Live preview

Self-check

Before you continue, prove that you own this lesson.

Intermediate

Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.

  1. Can you explain what problem this lesson solves in a real website?
  2. Can you identify the most important tag or attribute from this lesson?
  3. Can you name one accessibility mistake this lesson helps prevent?
  4. Can you write one good example and one weak example without copying the page?
  5. Can you explain when you would use this in production and when you would avoid it?