Input and label issue - Registration Form

I am having troubles at the step 15 of the registration form of the course Responsive Web Design (Beta). At the step it says:

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

I have the following code. Does anyone know where is the mistake?

      <fieldset>
        <label>
          Enter Your First Name: <input>
        </label>
        <label>
        Enter Your Last Name: <input>
        </label>
        <label>
        Enter Your Email: <input>
        </label>
        <label>
          Create a New Password: <input>
        </label>
      </fieldset>

Thanks,
Asier.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

It requires both the opening and closing input tags: <input></input>

And remember the Tutorial Wants you to:

Be sure to add each input after the label text, and include a space after the colon.
( Which has already been done)

Hi Alless,

Thanks for your help. I already tried adding opening and closing tags as well as making it self-closing as some users recomended but it keeps failing. I don’t know if it has something to do with a typo. I’ll keep trying!


      <fieldset>
        <label>
          Enter Your First Name: <input></input>
        </label>
        <label>
        Enter Your Last Name: <input></input>
        </label>
        <label>
        Enter Your Email: <input></input>
        </label>
        <label>
          Create a New Password: <input></input>
        </label>
      </fieldset>

:heavy_multiplication_x: You’re getting there. This may help:

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

Check to make sure there is not a space between </input> and </label>
If this does’t solve it, Go ahead and send a screenshot of the tutorial.

Link to challenge: https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-15

Here is the original code:

      <fieldset>
        <label>Enter Your First Name:</label>
        <label>Enter Your Last Name:</label>
        <label>Enter Your Email:</label>
        <label>Create a New Password:</label>
      </fieldset>

You added a bunch of line breaks, and those line breaks are confusing the tests.

You may want to RESET the challenge first, and try again as well… Sometimes things get out of place and they cause a problem with the Test read out, even if the answers are correct.

It was the space. Thanks Aless. I just went to the 16 step to check it and code looks like, in case it helps to anyone:


      <fieldset>
        <label>Enter Your First Name: <input /></label>
        <label>Enter Your Last Name: <input /></label>
        <label>Enter Your Email: <input /></label>
        <label>Create a New Password: <input /></label>
      </fieldset>

I’m glad you figured it out. It’s usually something like that: A space, a typo, an incorrect closing tag.

The Errors are always there. No matter how long you have been coding. All that matters… is to train your brain to see the errors as fast as possible, to save yourself time, and Frustration…

Thank you for your advice Alless! Whitout doubt it is necessary to train the brain to see those errors.

1 Like

Hi

can you please explain to me why the solution is "<input />" instead of the regular <input> ?

Nia

You don’t need <input />

1 Like

ok, thanks much for letting me know

Nia

Hi, may I ask what you do to pass the step? I encountered the same problem as yours. I made sure I had spaces after the colon. I even copied your code here but that didn’t work.

EDIT: NVM. I found the issue. I use Firefox Relay extension. That extension somehow makes the input element placed in the line after the “Enter Your Email:” text. Disabling it made my code pass.

Firefox Relay enabled