Skip to main content
Module 3 · Lesson 2 of 410/60 in the course~17 min
Module lessons (2/4)

Input Types, Constraints & Autocomplete

Lesson preview5 hands-on exercises readyModern HTML & CSS · Forms, Validation & Practical Accessibility

Pick semantic input types, select/textarea controls, required/minlength rules, and helpful autocomplete hints.

What you'll learn in this lesson

  • Choose purpose-built input types (email, tel, url, number, date, search, password) for cleaner mobile keyboards and UX.
  • Apply native browser validation rules (required, minlength, min, max, pattern) without writing custom JavaScript regex boilerplate first.
  • Add semantic autocomplete tokens (email, given-name, street-address) so password managers and autofill work smoothly.

Overview

Setting <input type="text"> everywhere wastes one of HTML's easiest UX wins: choosing the exact type instructs touch keyboards automatically—for example showing @ on email, numeric keypads on tel or inputmode="numeric", and clear-field buttons on search.

Notice name identifies each value sent to the server, while autocomplete identifies personal field tokens (name, email, new-password):

Sections covered in this lesson

  1. 1Better Input Types Unlock Mobile Keyboards Immediately
Pro Lesson · Forms, Validation & Practical Accessibility

Unlock "Input Types, Constraints & Autocomplete" and the full Modern HTML & CSS curriculum

Pick semantic input types, select/textarea controls, required/minlength rules, and helpful autocomplete hints.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.