Level 4 · Full-Stack Application Development · Course 4.1 React Fundamentals
Module 35: Forms and Validation in React
Goal: build forms in React that are pleasant to fill in, check input clearly, show helpful errors, and work for everyone, including keyboard and screen-reader users. You'll finish the enquiry dashboard project.
You'll need: your enquiries project from Module 34, and Module 13's form skills.
Lessons
- 1Form state15–25 minutes✓
- 2Validation rules15–25 minutes✓
- 3Error feedback15–25 minutes✓
- 4Accessible forms15–25 minutes✓
- 5Reusable form fields and form libraries15–25 minutes✓
🛠️Module practice: Course 4.1 project, a customer-enquiry dashboard
Finish the dashboard:
- A new-enquiry form with reusable fields, validation and accessible error messages.
- Enquiries listed with search, status filter, summary counts and status changes.
- Data remembered in localStorage.
- Tests for validation and any other pure logic.
- Works on a phone and with the keyboard; Lighthouse accessibility 90+. README and commit.
✅Module check
Explain in a few sentences, in your own words:
How do you build a React form that is easy and accessible to fill in, and validated properly?
Show a good answer
A good answer mentions: keep field values in one state object with one change handler, and handle submit with
preventDefault; validate with a pure, tested function (or a schema library) that returns errors per field; show
plain-language errors next to fields after they're visited or on submit, and move focus to the first error. Every
field has a label, errors are linked with aria-describedby and aria-invalid, results are announced with
role="status", and colour isn't the only signal. The server validates again.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
