Skip to main content

HTML Forms Overview — exercises and bug fixes

5 hands-on exercises and 5 find-the-bug challenges for the HTML Forms Overview lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.

Exercises(5)

  1. 1

    Add a form

    easy10 min

    Add a form element containing a submit button.

  2. 2

    Set the action

    easy10 min

    Point the form at /subscribe.

  3. 3

    Set the method

    easy10 min

    Make the form submit with POST.

  4. 4

    Name a field

    easy10 min

    Add a text input named email so it is submitted.

  5. 5

    Build a minimal working form

    medium10 min

    Combine action, method, a named field and a submit button.

Find the bug(5)

  1. 1

    Fix the input outside the form

    easy8 min

    A field outside the form is never submitted.

  2. 2

    Fix the missing name

    easy8 min

    Without a name the value is never sent.

  3. 3

    Fix the wrong method value

    easy8 min

    The method should be post, not send.

  4. 4

    Fix the wrong attribute for the target

    easy8 min

    Forms use action, not href.

  5. 5

    Fix the div used as a form

    easy8 min

    A div cannot submit anything.

Ready to write the code?

The editor, the automatic checks and the worked solutions open up with an account.

Open the workspace