diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index 5c1909f60e..b696d058ba 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -83,6 +83,7 @@ "title": "CSS Variables Skyline", "intro": ["", ""] }, + "registration-form": { "title": "Registration Form", "intro": ["", ""] }, "accessibility-quiz": { "title": "Accessibility Quiz", "intro": ["", ""] diff --git a/client/src/pages/learn/responsive-web-design/registration-form/index.md b/client/src/pages/learn/responsive-web-design/registration-form/index.md new file mode 100644 index 0000000000..83abe89a14 --- /dev/null +++ b/client/src/pages/learn/responsive-web-design/registration-form/index.md @@ -0,0 +1,10 @@ +--- +title: Introduction to the Registration Form +block: Registration Form +superBlock: Responsive Web Design +isBeta: true +--- + +## Introduction to the Registration Form + +This is a test for the new project-based curriculum. diff --git a/client/utils/help-category-map.json b/client/utils/help-category-map.json index 0ba7939635..91c49993b0 100644 --- a/client/utils/help-category-map.json +++ b/client/utils/help-category-map.json @@ -77,5 +77,6 @@ "periodic-table-database": "Relational Databases", "learn-github-by-building-a-list-of-inspirational-quotes": "Relational Databases", "number-guessing-game": "Relational Databases", - "accessibility-quiz": "HTML-CSS" + "accessibility-quiz": "HTML-CSS", + "registration-form": "HTML-CSS" } diff --git a/curriculum/challenges/_meta/registration-form/meta.json b/curriculum/challenges/_meta/registration-form/meta.json new file mode 100644 index 0000000000..808bb0b8cf --- /dev/null +++ b/curriculum/challenges/_meta/registration-form/meta.json @@ -0,0 +1,242 @@ +{ + "name": "Registration Form", + "isUpcomingChange": true, + "dashedName": "registration-form", + "order": 23, + "time": "5 hours", + "template": "", + "required": [], + "superBlock": "responsive-web-design", + "superOrder": 1, + "isBeta": true, + "challengeOrder": [ + [ + "60eebd07ea685b0e777b5583", + "Part 1" + ], + [ + "60f027099a15b00485563dd2", + "Part 2" + ], + [ + "60f027c87bc98f050395c139", + "Part 3" + ], + [ + "60f0286404aefb0562a4fdf9", + "Part 4" + ], + [ + "60f02e7361b68405e27b62a5", + "Part 5" + ], + [ + "60f030d388cb74067cf291c3", + "Part 6" + ], + [ + "60f1922fcbd2410527b3bd89", + "Part 7" + ], + [ + "60f1a5e2d2c23707a4f9a660", + "Part 8" + ], + [ + "60f1a9cbd23023082e149fee", + "Part 9" + ], + [ + "60f5c3e399ff1a05629964e4", + "Part 10" + ], + [ + "60f5cb8875ab6a0610f05071", + "Part 11" + ], + [ + "60f5d2776c854e069560fbe6", + "Part 12" + ], + [ + "60f5dc35c07ac1078f140916", + "Part 13" + ], + [ + "60f803d5241e6a0433a523a1", + "Part 14" + ], + [ + "60f805f813eaf2049bc2ceea", + "Part 15" + ], + [ + "60f80e0081e0f2052ae5b505", + "Part 16" + ], + [ + "60f81167d0d4910809f88945", + "Part 17" + ], + [ + "60f81616cff80508badf9ad5", + "Part 18" + ], + [ + "60f83e7bfc09900959f41e20", + "Part 19" + ], + [ + "60f84ec41116b209c280ba91", + "Part 20" + ], + [ + "60f852f645b5310a8264f555", + "Part 21" + ], + [ + "60f85a62fb30c80bcea0cedb", + "Part 22" + ], + [ + "60f8604682407e0d017bbf7f", + "Part 23" + ], + [ + "60f8618d191b940d62038513", + "Part 24" + ], + [ + "60fab4a123ce4b04526b082b", + "Part 25" + ], + [ + "60fab8367d35de04e5cb7929", + "Part 26" + ], + [ + "60fab9f17fa294054b74228c", + "Part 27" + ], + [ + "60fabf0dd4959805dbae09e6", + "Part 28" + ], + [ + "60fac4095512d3066053d73c", + "Part 29" + ], + [ + "60fac56271087806def55b33", + "Part 30" + ], + [ + "60fac8d7fdfaee0796934f20", + "Part 31" + ], + [ + "60faca286cb48b07f6482970", + "Part 32" + ], + [ + "60facde2d0dc61085b41063f", + "Part 33" + ], + [ + "60facf914c7b9b08d7510c2c", + "Part 34" + ], + [ + "60fad0a812d9890938524f50", + "Part 35" + ], + [ + "60fad1cafcde010995e15306", + "Part 36" + ], + [ + "60fad6dfcc0d930a59becf12", + "Part 37" + ], + [ + "60fad8e6148f310bba7890b1", + "Part 38" + ], + [ + "60fad99e09f9d30c1657e790", + "Part 39" + ], + [ + "60fadb18058e950c73925279", + "Part 40" + ], + [ + "60fadce90f85c50d0bb0dd4f", + "Part 41" + ], + [ + "60fadd972e6ffe0d6858fa2d", + "Part 42" + ], + [ + "60fadfa2b540b70dcfa8b771", + "Part 43" + ], + [ + "60fc219d333e37046f474a6e", + "Part 44" + ], + [ + "60fc22d1e64d1b04cdd4e602", + "Part 45" + ], + [ + "60fc236dc04532052926fdac", + "Part 46" + ], + [ + "60ffe1bc30415f042faea936", + "Part 47" + ], + [ + "60ffe3936796ac04959285a9", + "Part 48" + ], + [ + "60ffe4f4ec18cd04dc470c56", + "Part 49" + ], + [ + "60ffe69ee377c6055e192a46", + "Part 50" + ], + [ + "60ffe7d8aae62c05bcc9e7eb", + "Part 51" + ], + [ + "60ffe8a5ceb0e90618db06d9", + "Part 52" + ], + [ + "60ffe947a868ec068f7850f6", + "Part 53" + ], + [ + "60ffe9cb47809106eda2f2c9", + "Part 54" + ], + [ + "60ffec2825da1007509ddd06", + "Part 55" + ], + [ + "60ffecefac971607ae73c60f", + "Part 56" + ], + [ + "60ffefd6479a3d084fb77cbc", + "Part 57" + ] + ] +} \ No newline at end of file diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-001.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-001.md new file mode 100644 index 0000000000..2f5a5741a7 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-001.md @@ -0,0 +1,46 @@ +--- +id: 60eebd07ea685b0e777b5583 +title: Part 1 +challengeType: 0 +dashedName: part-1 +--- + +# --description-- + +Welcome to the Registration Form project! Start by adding the `!DOCTYPE html` declaration at the top of the document so the browser knows what type of document it's reading. + +# --hints-- + +Your code should contain the `DOCTYPE` reference. + +```js +assert(code.match(/` after the type. + +```js +assert(code.match(/html\s*>/gi)); +``` + +# --seed-- + +## --seed-contents-- + +```html +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-002.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-002.md new file mode 100644 index 0000000000..a10c4a7f5a --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-002.md @@ -0,0 +1,54 @@ +--- +id: 60f027099a15b00485563dd2 +title: Part 2 +challengeType: 0 +dashedName: part-2 +--- + +# --description-- + +Add opening and closing `html` tags below the `DOCTYPE` so you have a place to start putting some code. + +# --hints-- + +Your `html` element should be below the `DOCTYPE` declaration. + +```js +assert(code.match(/(?)/gi)); +``` + +Your `html` element should have an opening tag. + +```js +assert(code.match(//gi)); +``` + +Your `html` element should have a closing tag. + +```js +assert(code.match(/<\/html\s*>/)); +``` + +Your `html` tags should be in the correct order. + +```js +assert(code.match(/\s*<\/html\s*>/)); +``` + +You should only have one `html` element. + +```js +// Possibly a redundant test, as browser fixes this +assert(document.querySelectorAll('html').length === 1); +``` + +# --seed-- + +## --seed-contents-- + +```html +--fcc-editable-region-- + + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-003.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-003.md new file mode 100644 index 0000000000..c333805a44 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-003.md @@ -0,0 +1,67 @@ +--- +id: 60f027c87bc98f050395c139 +title: Part 3 +challengeType: 0 +dashedName: part-3 +--- + +# --description-- + +Next, add opening and closing `head` and `body` tags within the `html` element. + +# --hints-- + +You should have an opening `head` tag. + +```js +assert(code.match(/
/i)); +``` + +You should have a closing `head` tag. + +```js +assert(code.match(/<\/head\s*>/i)); +``` + +You should have an opening `body` tag. + +```js +assert(code.match(//i)); +``` + +You should have a closing `body` tag. + +```js +assert(code.match(/<\/body\s*>/i)); +``` + +The `head` and `body` elements should be siblings. + +```js +assert(document.querySelector('head')?.nextElementSibling.localName === 'body'); +``` + +The `head` element should be within the `html` element. + +```js +assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head')); +``` + +The `body` element should be within the `html` element. + +```js +assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body')); +``` + +# --seed-- + +## --seed-contents-- + +```html +--fcc-editable-region-- + + + + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-004.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-004.md new file mode 100644 index 0000000000..2706172ed0 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-004.md @@ -0,0 +1,101 @@ +--- +id: 60f0286404aefb0562a4fdf9 +title: Part 4 +challengeType: 0 +dashedName: part-4 +--- + +# --description-- + +Add a `title` element to the `head`, and give your project a title of `freeCodeCamp Registration Form Project`. Also, nest a self-closing `link` element in the `head` element. Give it a `rel` attribute value of `stylesheet`, a `type` attribute value of `text/css`, and an `href` attribute value of `styles.css`. + +# --hints-- + +Your code should have a `title` element. + +```js +const title = document.querySelector('title'); +assert.exists(title); +``` + +The `title` element should be within the `head` element. + +```js +const head = document.querySelector('head'); +// TODO: head does not contain title...body contains title +assert(true); +``` + +Your project should have a title of `freeCodeCamp Registration Form Project`. + +```js +const title = document.querySelector('title'); +assert.equal(title.text.toLowerCase(), 'freecodecamp registration form project') +``` + +Remember, the casing and spelling matters for the title. + +```js +const title = document.querySelector('title'); +assert.equal(title.text, 'freeCodeCamp Registration Form Project'); +``` + +Your code should have a `link` element. + +```js +assert.match(code, //i)); +``` + +Your `link` element should be within your `head` element. + +```js +assert(code.match(/[\w\W\s]*[\w\W\s]*<\/head>/i)) +``` + +Your `link` element should have a `rel` attribute with the value `stylesheet`. + +```js +assert.match(code, / + + --fcc-editable-region-- + + + + + +--fcc-editable-region-- + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-005.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-005.md new file mode 100644 index 0000000000..b79eee0437 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-005.md @@ -0,0 +1,43 @@ +--- +id: 60f02e7361b68405e27b62a5 +title: Part 5 +challengeType: 0 +dashedName: part-5 +--- + +# --description-- + +Within the `body`, provide a heading context for the content, by adding an `h1` with the text `Registration Form`. + +# --hints-- + +You should add the `h1` within the `body`. + +```js +assert.exists(document.querySelector('body > h1')); +``` + +You should give the `h1` the text `Registration Form`. + +```js +assert.equal(document.querySelector('body > h1')?.textContent, 'Registration Form'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + +``` + +```css +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-008.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-008.md new file mode 100644 index 0000000000..69c49f2568 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-008.md @@ -0,0 +1,51 @@ +--- +id: 60f1a5e2d2c23707a4f9a660 +title: Part 8 +challengeType: 0 +dashedName: part-8 +--- + +# --description-- + +Now, get rid of the horizontal scroll-bar, by setting the `body` default `margin` added by some browsers to `0`. + +# --hints-- + +You should add `margin` within the `body` element selector. + +```js +assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('body')?.margin); +``` + +You should give the `margin` a value of `0`. + +```js +assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.margin, '0px'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + +``` + +```css +--fcc-editable-region-- +body { + width: 100%; + height: 100vh; +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-009.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-009.md new file mode 100644 index 0000000000..4d6a77f056 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-009.md @@ -0,0 +1,64 @@ +--- +id: 60f1a9cbd23023082e149fee +title: Part 9 +challengeType: 0 +dashedName: part-9 +--- + +# --description-- + +That is better. Now, make the background easy on the eyes, by changing the `body` `background-color` to `#1b1b32`. Then, to see the text, change the `color` to `#f5f6f7`. + +# --hints-- + +You should add the `background-color` within the `body` element selector. + +```js +assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor); +``` + +You should give the `background-color` a value of `#1b1b32`. + +```js +assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.backgroundColor, 'rgb(27, 27, 50)'); +``` + +You should add the `color` within the `body` element selector. + +```js +assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('body')?.color); +``` + +You should give the `color` a value of `#f5f6f7`. + +```js +assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.color, 'rgb(245, 246, 247)'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + +``` + +```css +--fcc-editable-region-- +body { + width: 100%; + height: 100vh; + margin: 0; +} +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-010.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-010.md new file mode 100644 index 0000000000..23499e37a7 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-010.md @@ -0,0 +1,63 @@ +--- +id: 60f5c3e399ff1a05629964e4 +title: Part 10 +challengeType: 0 +dashedName: part-10 +--- + +# --description-- + +As suggested by the title, you are creating a form. So, after the `p` element, insert a `form` with an `action` attribute targetting `https://fcc-registration-form.com`. + +# --hints-- + +You should add a `form` element adjacent the `p` element. + +```js +assert.exists(document.querySelector('p + form')); +``` + +You should give the `form` an `action` attribute. + +```js +// Default action points to window location +assert.notEqual(document.querySelector('form')?.action, window?.location?.href); +``` + +You should give the `action` a value of `https://fcc-registration-form.com`. + +```js +// TODO: Do we need to use an in-house (domain) URL - just-in-case +assert.equal(document.querySelector('form')?.action, 'https://fcc-registration-form.com/'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + +--fcc-editable-region-- + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-011.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-011.md new file mode 100644 index 0000000000..c9f716f439 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-011.md @@ -0,0 +1,63 @@ +--- +id: 60f5cb8875ab6a0610f05071 +title: Part 11 +challengeType: 0 +dashedName: part-11 +--- + +# --description-- + +Seeing as we plan on having three distinct sections to the form, add three `fieldset` elements within the `form`. + +# --hints-- + +You should add three `fieldset` elements. + +```js +assert.equal(document.querySelectorAll('fieldset')?.length, 3); +``` + +The three `fieldset` elements should be within the `form`. + +```js +assert.equal(document.querySelectorAll('form > fieldset')?.length, 3); +``` + +The three `fieldset` elements should be siblings. + +```js +assert.exists(document.querySelector('fieldset + fieldset + fieldset')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + +--fcc-editable-region-- + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-012.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-012.md new file mode 100644 index 0000000000..9b45666c77 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-012.md @@ -0,0 +1,61 @@ +--- +id: 60f5d2776c854e069560fbe6 +title: Part 12 +challengeType: 0 +dashedName: part-12 +--- + +# --description-- + +The first `fieldset` will hold name, email, and password fields. Start by adding four `label` elements to the first `fieldset`. + +# --hints-- + +You should add four `label` elements. + +```js +assert.equal(document.querySelectorAll('label')?.length, 4); +``` + +You should add the `label` elements to the first `fieldset`. + +```js +assert.equal(document.querySelector('fieldset')?.querySelectorAll('label')?.length, 4); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+--fcc-editable-region-- + +--fcc-editable-region-- + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-013.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-013.md new file mode 100644 index 0000000000..20af4d45d1 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-013.md @@ -0,0 +1,81 @@ +--- +id: 60f5dc35c07ac1078f140916 +title: Part 13 +challengeType: 0 +dashedName: part-13 +--- + +# --description-- + +Add the following text to the `label` elements: + +- `Enter Your First Name:` +- `Enter Your Last Name:` +- `Enter Your Email:` +- `Create a New Password:` + +# --hints-- + +The first `label` should have the text `Enter Your First Name:`. + +```js +assert.match(document.querySelector('label')?.innerHTML, /Enter Your First Name:/i); +``` + +The second `label` should have the text `Enter Your Last Name:`. + +```js +assert.match(document.querySelector('fieldset > label:nth-child(2)')?.innerHTML, /Enter Your Last Name:/i); +``` + +The third `label` should have the text `Enter Your Email:`. + +```js +assert.match(document.querySelector('fieldset > label:nth-child(3)')?.innerHTML, /Enter Your Email:/i); +``` + +The fourth `label` should have the text `Create a New Password:`. + +```js +assert.match(document.querySelector('fieldset > label:nth-child(4)')?.innerHTML, /Create a New Password:/i); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-014.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-014.md new file mode 100644 index 0000000000..beb79bf783 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-014.md @@ -0,0 +1,72 @@ +--- +id: 60f803d5241e6a0433a523a1 +title: Part 14 +challengeType: 0 +dashedName: part-14 +--- + +# --description-- + +As `label` elements are `inline` by default, they appear on the same line as the text they are labelling. To make them appear on separate lines, add `display: block` to the `label` element, and add a `margin` of `0.5rem 0`, to separate them from each other. + +# --hints-- + +You should use the `label` selector. + +```js +assert.exists(new __helpers.CSSHelp(document).getStyle('label')); +``` + +You should add a `display` property of value `block`. + +```js +assert.equal(new __helpers.CSSHelp(document).getStyle('label')?.display, 'block'); +``` + +You should add a `margin` property of value `0.5rem 0`. + +```js +assert.equal(new __helpers.CSSHelp(document).getStyle('label')?.margin, '0.5rem 0px'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-015.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-015.md new file mode 100644 index 0000000000..fb317d0443 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-015.md @@ -0,0 +1,94 @@ +--- +id: 60f805f813eaf2049bc2ceea +title: Part 15 +challengeType: 0 +dashedName: part-15 +--- + +# --description-- + +Nest an `input` element within each `label`. Be sure to add each `input` after the `label` text, and include a space after the colon. + +# --hints-- + +You should add four `input` elements to the `fieldset` element. + +```js +assert.equal(document.querySelectorAll('fieldset input')?.length, 4); +``` + +You should nest the `input` elements within the `label` elements. + +```js +assert.equal(document.querySelectorAll('label input')?.length, 4); +``` + +You should add the first `input` after the `label` text `Enter Your First Name:`, and include a space after the colon. + +```js +assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML, 'Enter Your First Name: '); +``` + +You should add the second `input` after the `label` text `Enter Your Last Name:`, and include a space after the colon. + +```js +assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML, 'Enter Your Last Name: '); +``` + +You should add the third `input` after the `label` text `Enter Your Email:`, and include a space after the colon. + +```js +assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML, 'Enter Your Email: '); +``` + +You should add the fourth `input` after the `label` text `Create a New Password:`, and include a space after the colon. + +```js +assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML, 'Create a New Password: '); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-016.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-016.md new file mode 100644 index 0000000000..3773a48f21 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-016.md @@ -0,0 +1,87 @@ +--- +id: 60f80e0081e0f2052ae5b505 +title: Part 16 +challengeType: 0 +dashedName: part-16 +--- + +# --description-- + +Specifying the `type` attribute of a form element is important for the browser to know what kind of data it should expect. If the `type` is not specified, the browser will default to `text`. + +Give the first two `input` elements a `type` attribute of `text`, the third a `type` attribute of `email`, and the fourth a `type` attribute of `password`. + +The `email` type only allows emails with a `@` and a `.` in the domain. +The `password` type obscures the input, and warns if the site does not use HTTPS. + +# --hints-- + +You should give the first `input` element a `type` attribute of `text`. + +```js +assert.equal(document.querySelector('input')?.type, 'text'); +``` + +You should give the second `input` element a `type` attribute of `text`. + +```js +assert.equal(document.querySelectorAll('input')?.[1]?.type, 'text'); +``` + +You should give the third `input` element a `type` attribute of `email`. + +```js +assert.equal(document.querySelectorAll('input')?.[2]?.type, 'email'); +``` + +You should give the fourth `input` element a `type` attribute of `password`. + +```js +assert.equal(document.querySelectorAll('input')?.[3]?.type, 'password'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-017.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-017.md new file mode 100644 index 0000000000..946c0a6600 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-017.md @@ -0,0 +1,79 @@ +--- +id: 60f81167d0d4910809f88945 +title: Part 17 +challengeType: 0 +dashedName: part-17 +--- + +# --description-- + +The first `input` element with a `type` of `submit` is automatically set to submit its nearest parent `form` element. + +To handle the form submission, after the last `fieldset` element add an `input` element with the `type` attribute set to `submit` and the `value` attribute set to `Submit`. + +# --hints-- + +You should add the `input` element after the last `fieldset` element. + +```js +assert.exists(document.querySelectorAll('fieldset')?.[2]?.nextElementSibling?.tagName, 'input'); +``` + +You should give the `input` element a `type` attribute of `submit`. + +```js +assert.exists(document.querySelector('fieldset + input[type="submit"]')); +``` + +You should give the `input` element a `value` attribute of `Submit`. + +```js +assert.exists(document.querySelector('fieldset + input[value="Submit"]')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-018.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-018.md new file mode 100644 index 0000000000..0179a0a027 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-018.md @@ -0,0 +1,93 @@ +--- +id: 60f81616cff80508badf9ad5 +title: Part 18 +challengeType: 0 +dashedName: part-18 +--- + +# --description-- + +At this point, you should be able to submit the form. However, you might notice not much happens. + +To make the form more interactive, add the `required` attribute to the `input` elements in the first `fieldset`. + +Now, if you try to submit the form without filling in the required fields, you will see an error message. + +# --hints-- + +You should give the first `input` element a `required` attribute. + +```js +assert.equal(document.querySelector('input')?.required, true); +``` + +You should give the second `input` element a `required` attribute. + +```js +assert.equal(document.querySelectorAll('input')?.[1]?.required, true); +``` + +You should give the third `input` element a `required` attribute. + +```js +assert.equal(document.querySelectorAll('input')?.[2]?.required, true); +``` + +You should give the fourth `input` element a `required` attribute. + +```js +assert.equal(document.querySelectorAll('input')?.[3]?.required, true); +``` + +You should not give the `submit` `input` a `required` attribute. + +```js +assert.equal(document.querySelector('input[type="submit"]')?.required, false); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-019.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-019.md new file mode 100644 index 0000000000..cb5c802804 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-019.md @@ -0,0 +1,73 @@ +--- +id: 60f83e7bfc09900959f41e20 +title: Part 19 +challengeType: 0 +dashedName: part-19 +--- + +# --description-- + +Certain `type` attribute values come with built-in form validation. For example, `type="email"` requires that the value be a valid email address. + +Add custom validation to the password `input` element, by adding a `minlength` attribute with a value of `8`. Doing so prevents inputs of less than 8 characters being submitted. + +# --hints-- + +You should give the password `input` element a `minlength` attribute. + +```js +assert.notEqual(document.querySelector('input[type="password"]')?.minLength, -1); +``` + +You should give the `minlength` attribute a value of `8`. + +```js +assert.equal(document.querySelector('input[type="password"]')?.minLength, 8); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-020.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-020.md new file mode 100644 index 0000000000..fe8614fbe8 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-020.md @@ -0,0 +1,81 @@ +--- +id: 60f84ec41116b209c280ba91 +title: Part 20 +challengeType: 0 +dashedName: part-20 +--- + +# --description-- + +With `type="password"` you can use the `pattern` attribute to define a regular expression that the password must match to be considered valid. + +Add a `pattern` attribute to the password `input` element to require the input match: `[a-z0-5]{8,}` + +The above is a regular expression which matches eight or more lowercase letters or the digits `0` to `5`. Then, remove the `minlength` attribute, and try it out. + +# --hints-- + +You should give the password `input` element a `pattern` attribute. + +```js +assert.isNotEmpty(document.querySelector('input[type="password"]')?.pattern); +``` + +You should give the `pattern` attribute a value of `[a-z0-5]{8,}`. + +```js +assert.equal(document.querySelector('input[type="password"]')?.pattern, '[a-z0-5]{8,}'); +``` + +You should remove the `minlength` attribute from the password `input` element. + +```js +assert.equal(document.querySelector('input[type="password"]')?.minLength, -1); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-021.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-021.md new file mode 100644 index 0000000000..9d57789b50 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-021.md @@ -0,0 +1,75 @@ +--- +id: 60f852f645b5310a8264f555 +title: Part 21 +challengeType: 0 +dashedName: part-21 +--- + +# --description-- + +Let us go to the next part of the registration form. This section will ask for the type of account the user is opening, and will confirm the user has read the terms and conditions. + +Start by adding three `label` elements to the second `fieldset`. + +# --hints-- + +You should add three `label` elements to the second `fieldset`. + +```js +assert.equal(document.querySelectorAll('fieldset')?.[1]?.querySelectorAll('label')?.length, 3); +``` + +The `label` elements should be siblings. + +```js +assert.exists(document.querySelector('fieldset:nth-child(2)')?.querySelector('label + label + label')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-022.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-022.md new file mode 100644 index 0000000000..7a2a5adb6c --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-022.md @@ -0,0 +1,84 @@ +--- +id: 60f85a62fb30c80bcea0cedb +title: Part 22 +challengeType: 0 +dashedName: part-22 +--- + +# --description-- + +Users will be allowed to chose either a `Personal Account` or `Business Account`. + +To do this, within each of the first two `label` elements, add one `input` element with `type="radio"`. + +# --hints-- + +You should add two `input` elements. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(2) input')?.length, 2); +``` + +You should add one `input` to each of the first two `label` elements. + +```js +assert.exists(document.querySelector('fieldset:nth-child(2) > label:nth-child(1) > input')); +assert.exists(document.querySelector('fieldset:nth-child(2) > label:nth-child(2) > input')); +``` + +You should give both `input` elements a `type` of `radio`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(2) input[type="radio"]')?.length, 2); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-023.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-023.md new file mode 100644 index 0000000000..baffa4b84e --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-023.md @@ -0,0 +1,81 @@ +--- +id: 60f8604682407e0d017bbf7f +title: Part 23 +challengeType: 0 +dashedName: part-23 +--- + +# --description-- + +For the terms and conditions, add an `input` of with a `type` of `checkbox` to the third `label` element. Also, as we do not want users to sign up, without having read the terms and conditions, make it `required`. + +# --hints-- + +You should add an `input` to the third `label` element. + +```js +assert.exists(document.querySelector('fieldset:nth-child(2) label:nth-child(3) input')); +``` + +You should add a `type` attribute of value `checkbox` to the `input` element. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) label:nth-child(3) input')?.type, 'checkbox'); +``` + +You should add a `required` attribute to the `input` element. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) label:nth-child(3) input')?.required, true); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-024.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-024.md new file mode 100644 index 0000000000..e49ffd1e0e --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-024.md @@ -0,0 +1,105 @@ +--- +id: 60f8618d191b940d62038513 +title: Part 24 +challengeType: 0 +dashedName: part-24 +--- + +# --description-- + +Within each corresponding `label` element, and immediately after the `input` element, add a space and add the following text: + +```md +Personal Account +Business Account +I accept the terms and conditions +``` + +# --hints-- + +You should give the first `label` the text `Personal Account`. + +```js +assert.include(document.querySelector('fieldset:nth-child(2) > label')?.innerText, 'Personal Account'); +``` + +You should give the second `label` the text `Business Account`. + +```js +assert.include(document.querySelector('fieldset:nth-child(2) > label:nth-child(2)')?.innerText, 'Business Account'); +``` + +You should give the third `label` the text `I accept the terms and conditions`. + +```js +assert.include(document.querySelector('fieldset:nth-child(2) > label:nth-child(3)')?.innerText, 'I accept the terms and conditions'); +``` + +You should give the first `label` text one space at the front. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) > label')?.innerText?.[0], ' '); +``` + +You should give the second `label` text one space at the front. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) > label:nth-child(2)')?.innerText?.[0], ' '); +``` + +You should give the third `label` text one space at the front. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) > label:nth-child(3)')?.innerText?.[0], ' '); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-025.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-025.md new file mode 100644 index 0000000000..96ecbd3e87 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-025.md @@ -0,0 +1,83 @@ +--- +id: 60fab4a123ce4b04526b082b +title: Part 25 +challengeType: 0 +dashedName: part-25 +--- + +# --description-- + +You only want one radio input to be selectable at a time. However, the form does not know the radio inputs are related. + +To relate the radio inputs, give them the same `name` attribute with a value of `account-type`. Now, it is not possible to select both radio inputs at the same time. + +# --hints-- + +You should give the first radio input the `name` attribute with a value of `account-type`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) label:nth-child(1) input[type="radio"]')?.name, 'account-type'); +``` + +You should give the second radio input the `name` attribute with a value of `account-type`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) label:nth-child(2) input[type="radio"]')?.name, 'account-type'); +``` + +You should not give the `checkbox` the `name` attribute. + +```js +assert.isEmpty(document.querySelector('fieldset:nth-child(2) label:nth-child(3) input[type="checkbox"]')?.name); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-026.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-026.md new file mode 100644 index 0000000000..52585c4d08 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-026.md @@ -0,0 +1,85 @@ +--- +id: 60fab8367d35de04e5cb7929 +title: Part 26 +challengeType: 0 +dashedName: part-26 +--- + +# --description-- + +To finish this `fieldset` off, link the text `terms and conditions` to the following location: + +```md +https://www.freecodecamp.org/news/terms-of-service/ +``` + +# --hints-- + +You should use an `a` element to link to the terms and conditions. + +```js +assert.exists(document.querySelector('fieldset:nth-child(2) > label:nth-child(3) > input + a')); +``` + +You should give the `a` element an `href` of `https://www.freecodecamp.org/news/terms-of-service/`. + +```js +assert.match(document.querySelector('fieldset:nth-child(2) > label:nth-child(3) > input + a')?.href, /https:\/\/www\.freecodecamp\.org\/news\/terms-of-service\/?/); +``` + +You should only wrap the `a` element around the text `terms and conditions`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(2) > label:nth-child(3) > input + a')?.textContent, 'terms and conditions'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-027.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-027.md new file mode 100644 index 0000000000..ecd523e66e --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-027.md @@ -0,0 +1,88 @@ +--- +id: 60fab9f17fa294054b74228c +title: Part 27 +challengeType: 0 +dashedName: part-27 +--- + +# --description-- + +Moving on to the final `fieldset`. What if you wanted to allow a user to upload a profile picture? + +Well, the `input` type `file` allows just that. Add a `label` with the text `Upload a profile picture: `, and add an `input` accepting a file upload. + +# --hints-- + +You should add a `label` with the text `Upload a profile picture: `. + +```js +assert.match(document.querySelector('fieldset:nth-child(3) > label')?.innerText, /Upload a profile picture:/i); +``` + +You should nest an `input` element inside the `label` element. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label > input')); +``` + +You should give the `input` element a `type` of `file`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(3) > label > input')?.type, 'file'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-028.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-028.md new file mode 100644 index 0000000000..d3dc4458f7 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-028.md @@ -0,0 +1,102 @@ +--- +id: 60fabf0dd4959805dbae09e6 +title: Part 28 +challengeType: 0 +dashedName: part-28 +--- + +# --description-- + +Add another `label` after the first, with the text `Input your age (years): `. Then, nest an `input` with the `type` of `number`. + +As we do not want users under the age of 13 to register, add a `min` attribute to the `input` with a value of `13`. Also, we can probably assume users over the age of 120 will not register; add a `max` attribute with a value of `120`. + +Now, if someone tries to submit the form with values outside of the range, a warning will appear, and the form will not submit. Give it a try. + +# --hints-- + +You should add a `label` to the third `fieldset`, after the existing `label`. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label + label')); +``` + +You should give the `label` the text `Input your age (years): `. + +```js +assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(2)')?.textContent, 'Input your age (years): '); +``` + +You should give the `label` an `input` with `type` of `number`. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label:nth-child(2) > input[type="number"]')); +``` + +You should give the `input` a `min` attribute with a value of `13`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(2) > input[type="number"]')?.min, '13'); +``` + +You should give the `input` a `max` attribute with a value of `120`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(2) > input[type="number"]')?.max, '120'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-029.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-029.md new file mode 100644 index 0000000000..d864a3bd78 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-029.md @@ -0,0 +1,84 @@ +--- +id: 60fac4095512d3066053d73c +title: Part 29 +challengeType: 0 +dashedName: part-29 +--- + +# --description-- + +Adding a dropdown to the form is easy with the `select` element. The `select` element is a container for a group of `option` elements, and the `option` element acts as a label for each dropdown option. Both elements require closing tags. + +Start, by adding a `select` element below the two `input` elements. Then, nest 5 `option` elements within the `select` element. + +# --hints-- + +You should add a `select` element to the third `fieldset`. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > select')); +``` + +You should nest 5 `option` elements inside the `select` element. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > select > option')?.length, 5); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-030.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-030.md new file mode 100644 index 0000000000..386c799c4b --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-030.md @@ -0,0 +1,94 @@ +--- +id: 60fac56271087806def55b33 +title: Part 30 +challengeType: 0 +dashedName: part-30 +--- + +# --description-- + +Nest the `select` element within a `label` element with the text `How did you hear about us?`. The text should come before the `select` element. + +# --hints-- + +You should nest only the `select` element within a `label` element. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label:nth-child(3) > select')); +``` + +You should give the `label` element the text `How did you hear about us?`. + +```js +assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(3)')?.innerText?.trim(), 'How did you hear about us?'); +``` + +You should place the text before the `select` element. + +```js +assert.match(document.querySelector('fieldset:nth-child(3) > label:nth-child(3)')?.innerHTML?.replace(/[\t\n]+/g, ''), /^How did you hear about us\?/); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-031.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-031.md new file mode 100644 index 0000000000..8b70cb36ab --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-031.md @@ -0,0 +1,116 @@ +--- +id: 60fac8d7fdfaee0796934f20 +title: Part 31 +challengeType: 0 +dashedName: part-31 +--- + +# --description-- + +The dropdown options are currently empty. To give them content, add the following text to each subsequent `option` element: + +```md +(select one) +freeCodeCamp News +freeCodeCamp YouTube +freeCodeCamp Forum +Other +``` + +# --hints-- + +You should give the first `option` element the text `(select one)`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[0]?.textContent, '(select one)'); +``` + +You should give the second `option` element the text `freeCodeCamp News`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[1]?.textContent, 'freeCodeCamp News'); +``` + +You should give the third `option` element the text `freeCodeCamp YouTube`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[2]?.textContent, 'freeCodeCamp YouTube'); +``` + +You should give the fourth `option` element the text `freeCodeCamp Forum`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[3]?.textContent, 'freeCodeCamp Forum'); +``` + +You should give the fifth `option` element the text `Other`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[4]?.textContent, 'Other'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-032.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-032.md new file mode 100644 index 0000000000..927cfe63c4 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-032.md @@ -0,0 +1,110 @@ +--- +id: 60faca286cb48b07f6482970 +title: Part 32 +challengeType: 0 +dashedName: part-32 +--- + +# --description-- + +Submitting the form with an option selected would not send a useful value to the server. As such, each `option` needs to be given a `value` attribute. Without which, the text content of the `option` will be submitted to the server. + +Give the first `option` a `value` of `""`, and the subsequent `option` elements `value` attributes from `1` to `4`. + +# --hints-- + +You should give the first `option` a `value` of `""`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[0]?.value, ''); +``` + +You should give the second `option` a `value` of `1`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[1]?.value, '1'); +``` + +You should give the third `option` a `value` of `2`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[2]?.value, '2'); +``` + +You should give the fourth `option` a `value` of `3`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[3]?.value, '3'); +``` + +You should give the fifth `option` a `value` of `4`. + +```js +assert.equal(document.querySelectorAll('fieldset:nth-child(3) > label:nth-child(3) option')?.[4]?.value, '4'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + +Please fill out this form with the required information
+ + + +``` + +```css +body { + width: 100%; + height: 100vh; + margin: 0; + background-color: #1b1b32; + color: #f5f6f7; +} + +label { + display: block; + margin: 0.5rem 0; +} + +``` diff --git a/curriculum/challenges/english/01-responsive-web-design/registration-form/part-033.md b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-033.md new file mode 100644 index 0000000000..a744db25b4 --- /dev/null +++ b/curriculum/challenges/english/01-responsive-web-design/registration-form/part-033.md @@ -0,0 +1,105 @@ +--- +id: 60facde2d0dc61085b41063f +title: Part 33 +challengeType: 0 +dashedName: part-33 +--- + +# --description-- + +The `textarea` element acts like an `input` element of type `text`, but comes with the added benefit of being able to receive multi-line text, and an initial number of text rows and columns. + +To allow users to register with a bio, add a `label` with the text `Provide a bio:` followed by a `textarea` element. + +# --hints-- + +You should add a `label` element within the third `fieldset`, after the existing `label` elements. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label:nth-child(4)')); +``` + +You should give the `label` a text of `Provide a bio:`. + +```js +assert.match(document.querySelector('fieldset:nth-child(3) > label:nth-child(4)')?.innerText, /Provide a bio/); +``` + +You should nest a `textarea` element within the `label`. + +```js +assert.exists(document.querySelector('fieldset:nth-child(3) > label:nth-child(4) > textarea')); +``` + +You should give the `textarea` element opening and closing tags. + +```js +assert.match(code, /