Learn HTML Forms by Building a Registration Form - Step 17

I need to nest an input element within each label, I’m not sure where I am going wrong. The prompt is telling me to add the first input label after the text ‘Enter Your First Name’ but I thought I had already done this.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>

<!-- User Editable Region -->

      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name ></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name></label>
        <label for="email">Enter Your Email: <input id="email"></label>
        <label for="new-password">Create a New Password: <input id="new-password"></label>
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <fieldset></fieldset>
    </form>
  </body>
</html>
/* file: styles.css */
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

label {
  display: block;
  margin: 0.5rem 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Learn HTML Forms by Building a Registration Form - Step 17

Link to the challenge:

Two issues here.

  1. Your id attribute is malformed. You don’t have a second "

  2. I don’t think the instructions wanted you to add any attributes?

Thank you! Sorry I’m still very new to this what part is the ‘attribute’ I don’t need? Is that the ‘for’ part?

The attributes are the stuff in the opening tag that isn’t the element name.

1 Like

simply say your punctuations inside your id attributes is imcomplete

I don’t like using vague language like that when its not needed. Leaning the technical words is important.

1 Like
  <fieldset>
    <label for="first-name">Enter Your First Name: <input id="first-name"></label>
    <label for="last-name">Enter Your Last Name: <input id="last-name"></label>
    <label for="email">Enter Your Email: <input id="email"></label>
    <label for="new-password">Create a New Password: <input id="new-password"></label>
  </fieldset>

Cool, so you need to fix this part now

Adding extra code can make it harder for the tests to see what you did.

I took that out but I am still getting the same prompt as before.

  <fieldset>
    <label>Enter Your First Name: <input id="first-name"></label>
    <label>Enter Your Last Name: <input id="last-name"></label>
    <label>Enter Your Email: <input id="email"></label>
    <label>Create a New Password: <input id="new-password"></label>
  </fieldset>

You should add the first input after the label text Enter Your First Name: , and include a space after the colon.

You did not take out the id attribute. Its still there.

so should it say input=“first-name” ?

  <fieldset>
    <label>Enter Your First Name: <input="first-name"></label>
    <label>Enter Your Last Name: <input="last-name"></label>
    <label>Enter Your Email: <input="email"></label>
    <label>Create a New Password: <input="new-password"></label>
  </fieldset>

You should add four input elements to the fieldset element.

Where are the instructions asking you to add "first-name"? I don’t see that?

Step 17

Nest an input element within each label. Be sure to add each input after the label text, and include a space after the colon.

Ok… so

I literally see nothing about adding "first-name".

Taking that out worked thank you! It was where I looked at old forums first for help and they all had it included. Thank you for your help

Such is the danger of old answers

Ah yeah, I really wanted to try and solve it on my own but I’ve only been learning for a week

This takes time to learn for sure

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.