Code Lab BetaBUILD. RUN. DISCOVER.

Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.

JAVASCRIPT / CHAPTER 05

JavaScript
Forms.

Forms in JavaScript: labels, reading fields, checkbox/radio, FormData, empty vs zero, HTML constraints, the Constraint API, aria errors, and a simulated signup. Client validation helps, but the server re-checks. Learn and Practice; challenges are separate.

Choose a section

Lesson with explanation and a guided task. Theory stays readable; completion requires a passing solution.

Challenges are optional and do not block the next chapter.

Start lesson
JavaScript

10 lessons available

The foundations behind your ideas.

  1. 01

    Labels & Fields · Locked

    label for / input id

    Open lesson
  2. 02

    Read Controls · Locked

    value of text, number, select

    Open lesson
  3. 03

    Checkbox & Radio · Locked

    value vs checked

    Open lesson
  4. 04

    FormData · Locked

    FormData and name

    Open lesson
  5. 05

    Normalize & Zero · Locked

    trim, Number, empty vs 0

    Open lesson
  6. 06

    HTML Constraints · Locked

    required, type, min/max, pattern

    Open lesson
  7. 07

    Constraint API · Locked

    setCustomValidity and clearing

    Open lesson
  8. 08

    Aria Errors · Locked

    aria-invalid and aria-describedby

    Open lesson
  9. 09

    Submit & Reset · Locked

    preventDefault, success, reset()

    Open lesson
  10. 10

    Signup Project · Locked

    multi-field form with validation

    Open lesson
JavaScript forms — validation, FormData, and accessible errors | Code Lab