HTML forms: collecting input from users

16-minute lesson · module-webapps-02

You are previewing this course as a guest

Read anything and run any exercise you like. It all runs in your own browser, so nothing here is saved: no XP, no progress, and the AI tutor needs an account. Sign in and your work starts counting.

Sign in

HTML forms: collecting input from users

16-minute lesson · module-webapps-02

  • Write a basic HTML form with text fields and a submit button.
  • Explain how the action and method attributes control where and how a form submits.
  • Choose GET versus POST for a given form and justify the choice.
  • Connect a form field's name attribute to the key the server will read.

Source attribution

Status: adapted

How to Think Like a Computer Scientist: Interactive Edition source · Web Applications / Web Applications And Html Forms / Sending Data To A Web Application

Adaptation notes. Read-along lesson; no graded coding step because the server side cannot run in the Pyodide sandbox. The HTML form examples are for reading. A course-search form is the running example; prose is original.

License notes. Original chapter is GNU FDL 1.3 (Brad Miller, David Ranum, and the upstream Elkner/Downey/Meyers text). No verbatim text reproduced.