{ "$schema": "../schemas/code-crispies-module-schema.json", "id": "html-forms-basic", "title": "HTML Forms: Basic Inputs", "description": "Learn to create forms with various input types", "mode": "html", "difficulty": "beginner", "lessons": [ { "id": "form-structure", "title": "Form Structure", "description": "Every form needs a <form> wrapper. Inside, use <label> to describe inputs and <input> for user data entry.

The for attribute on labels should match the id on inputs for accessibility.", "task": "Create a form with:
1. A <label> with the text 'Name:' and for=\"name\" attribute
2. A text <input> with id=\"name\" and name=\"name\" attributes", "previewHTML": "", "previewBaseCSS": "body { font-family: system-ui; padding: 20px; } form { max-width: 300px; } label { display: block; margin-bottom: 5px; font-weight: 500; } input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }", "sandboxCSS": "", "initialCode": "", "solution": "
\n \n \n
", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "form", "message": "Wrap everything in a
element" }, { "type": "element_exists", "value": "label", "message": "Add a