Problem statement
A small signup form with four fields. Each field must show its own message next to it after the person leaves that field, and the submit button must stay off until every field is good. When the form is finally good and submitted, the fields empty out and a success banner appears.
Demo
The page, styles, form markup, labels, message paragraphs, submit button, and success banner are already scaffolded and wired. Only the validate function in src/js/validation.ts and the renderFieldError, renderSubmitEnabled and renderSuccess functions in src/js/render.ts are missing — implement them so every test passes. Do not edit any other file.
What to implement
- Show a short reminder next to the name box if the person leaves it blank.
- Show a short reminder next to the email box if the email does not look like a real email address.
- Show a short reminder next to the password box if the password is too short.
- Show a short reminder next to the confirm-password box if it does not match the password, and never show that reminder next to the password box.
- Only show a box's reminder after the person has left that box for the first time — before that, keep the space beside the box empty.
- While a reminder is showing, make the box read as invalid for screen readers and tie the box to its reminder; take those cues off again once the box is fixed.
- Keep the Create account button switched off while any of the four boxes still has a problem, and switch it on only when all four are fine.
- If the person tries to submit while something is still wrong, reveal a reminder next to every box that has a problem, keep the form filled in, and do not show the success banner.
- When the person submits a form where everything is fine, empty all four boxes, clear every reminder, switch the button back off, and reveal the success banner.
- Everything shown must come from checking the four values you were given — nothing should be hardcoded.
