Command Palette

Search for a command to run...

Hectal
Phase 4: Forms
HTML · Exercise 5 of 5 Previous
Intermediate

A sign-up form with real validation

Finish this sign-up form. username: required, 3 to 15 characters, lowercase letters and digits only, autofill token username. email: a required email input.

password: a required password input of at least 8 characters with the token that lets browsers suggest a strong password, and a visible hint ("At least 8 characters") linked with aria-describedby.

confirm: in the JavaScript tab, use setCustomValidity so this field is invalid whenever it doesn't match the password, and valid again when it does. The button should say Create account.

What Check tests

  1. username is required, 3–15 characters, lowercase letters and digits only
  2. username and email have autofill tokens and email is a required email input
  3. password is a required password input, 8+ characters, with new-password
  4. The password hint is linked with aria-describedby
  5. Different passwords make confirm invalid
  6. Matching passwords make confirm valid again
  7. The button submits and says Create account

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.