5 hands-on exercises and 5 find-the-bug challenges for the Form Submission and Validation lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Set a message when the form is submitted.
Reject an empty value with an error message.
Show a success message when the field has content.
Reject a value that is too short.
Reset the field and report success.
The submit handler is defined but the form never uses it.
The check passes when the field is empty and fails when it is filled.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceThe comparison lets a short value through and rejects a long one.
The guard blocks the message even though the value is valid.
The field should be cleared as part of submitting.