Code Zone Bug Lab / Episode 06
The Form That Accepts Blank Names
Rob submits a name made of spaces. The form welcomes nobody.

Your sprint ticket · In progress · DEV-149
The Form That Accepts Blank Names.
Customer report: I entered only spaces and the signup form said Welcome. It should ask for a name.
Steps to reproduce
- Replace the demo name with three spaces.
- Select Join demo.
- Compare the result with a real name and an empty field.
Validate a demo display name. Do not add account creation, passwords, or name-format restrictions.
Acceptance criteria
- An empty name is rejected.
- Spaces-only names are rejected.
- Tabs and newlines alone are rejected by the validation function.
- A real name is accepted, with surrounding whitespace removed.
Learning demo only. No real accounts, purchases, or external requests.
Reproduce → inspect → hypothesize → verify
Take the ticket.
Reproduce the reported behavior before editing. Read the Console and inspect the JS tab. Explain one hypothesis, make a focused change, then use Check challenge below the code screen. Edits update the preview. Reveal hints one at a time if needed.
Checking account and saved lab work…
Sign in to sync across devicesChoose the copy to continue with. Keeping the device copy replaces the account copy only after a revision check.
Loading the JavaScript and HTML editor…
Pass the checks or make three attempts to unlock an explained example.
Ready to test? Choose “Check challenge” after investigating.
Code and prediction notes recover in this browser and sync when signed in. Instructor examples stay separate. Reset replaces code, not prediction notes.
Replace your edits with the original broken example?
Try first. Reveal one clue at a time.
Need a lead?
1. Inspect the raw value.
Log JSON.stringify(name) and name.length. Spaces still count toward length.
2. Separate text from whitespace.
What does trim() return for a string containing only spaces?
3. Check the normalized value.
Reject the name when name.trim().length is zero. Keep real names with spaces inside them.
Your lab report
Show your reasoning.
“I expected… I observed… The console showed… My hypothesis was… I changed… I verified…”
Use Check challenge for automated behavior checks. Passing checks are useful evidence, not a complete code review.
Give others room to investigate: label solutions as spoilers.
Share your lab report on SKOOL (new tab) ↗