Codeably
Debug the form that forgets a name every time the email is wrong
A first web-development exercise with a bug you can observe and a fix you can explain.
Build a practice form with a name, email address and workshop choice. Fill in the name and workshop, then deliberately enter an incomplete email address. When the page shows an error, are the other two answers still there? A form that makes people start over treats a single typo as if every answer were wrong.
MDN’s client-side validation guide explains how native controls can check requirements and how developers can customize feedback. Start with the browser’s built-in behavior. Give the email field a visible label, use the email input type, and mark it required when an email really is necessary. A real service must also validate data on its server. MDN • Client-side form validation
Trace one bad submission
Write three expected observations before editing the code. The browser should identify the email field, the name should remain readable, and the workshop choice should stay selected. Try fixing the bug by separating the values the user has entered from the error message the application displays. Clearing an error does not require clearing all the values.
Run a second test with a blank name and a valid email. If the implementation always focuses the email field, you have uncovered a different bug. Finish by submitting valid practice data and checking that the success state appears once.
Save the failing example alongside your fix. When you explain the project, describe what the user lost, which state change caused the loss, and how you verified the correction. That is a complete beginner debugging story in a few lines of HTML and a small amount of state.