Skip to content
BuildExercises

Ship it path Security basics

Limit what people can type

Put limits on text fields so one visitor cannot paste a megabyte into your app.

Start this module

Example brief

A feedback box accepts any amount of text in both fields. A long paste could slow the page, fill storage or hide other entries.

An example. Use your own idea next.

Steps

  1. Use the starting project: paste a very long text into the message box. What happens?
  2. Ask for a length limit on the name and on the message, in the field and in the script, and say what to keep.
  3. Generate, then run the checks and the behaviour test.

What you will learn

Input validation
Checking what people type before using it: how long, what shape, whether it is empty.
Server-side checks
Checks done on a server. Limits in the page help honest visitors, but only a server can stop a dishonest one.

A sample prompt

Text boxes accept unlimited text. Limit the name to 60 characters and the message to 500, in the field and in the script. Keep the form and the log the same.

Write yours first, then compare.

To complete it

Pass all 9 checks and 1 behaviour tests on one version, then accept. You start from a working project and change it.

More in the ship it path

Last reviewed 2026-11-05 · version 1