Forms that people can complete
Connect labels and controls and use native validation.
- Difficulty
- beginner
- Time
- 50 minutes
- Last verified
- 9/21/2026
What you will build
Add a keyboard-usable feedback form with clear validation.
Understand the idea first
Every control needs a stable name, a suitable type, and helpful constraints.
Build it step by step
<form action="/thanks" method="post">
<fieldset>
<legend>Suggest an improvement</legend>
<label for="name">Name</label><input id="name" name="name" required />
<label for="email">Email</label
><input id="email" name="email" type="email" />
<label for="message">Suggestion</label
><textarea id="message" name="message" minlength="10" required></textarea>
<button type="submit">Send</button>
</fieldset>
</form>- Place the form at the end of main.
- Click labels and verify focus moves correctly.
- Test empty and malformed submissions.
- Complete it with only the keyboard.
Read the important lines
namelabels submitted data;idconnects a label.- Fieldset and legend name a group.
- Use native types and constraints first.
Common mistakes and what to check
| Symptom | What to check |
|---|---|
| Placeholder without label | The stable name is missing. |
| Button type omitted | State whether it submits. |
| Clickable div | Use a real button. |
Practice without copying
Add a stage select and a labelled public-display checkbox.
Check the answer after you try
Use select/options and a checkbox with matching label for/id.
Completion check
- My page contains the required new content
- I can explain the key tags or attributes without the answer
- I deliberately created and fixed at least one error