Learn HTML Forms by Building a Registration Form - Step 35

Tell us what’s happening:

well, i have a problem and the code is not accepted! any ideas?

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'>
      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <legend>Account type (required)</legend>
        <label for="personal-account"><input id="personal-account" type="radio" name="account-type" checked /> Personal</label>
        <label for="business-account"><input id="business-account" type="radio" name="account-type" /> Business</label>
      </fieldset>

<!-- User Editable Region -->

    <fieldset>
    <label>Upload a profile picture: <input type="file" /></label>
    <label>Input your age (years): <input type="number" min="13" max="120" /></label>

    <label for="countryDropdown">How did you hear about us?
        <select id="countryDropdown" name="country">
            <option value="usa">USA</option>
            <option value="canada">Canada</option>
            <option value="uk">UK</option>
            <option value="australia">Australia</option>
            <option value="other">Other</option>
        </select>
    </label>
</fieldset>









<!-- User Editable Region -->

      <label for="terms-and-conditions">
        <input id="terms-and-conditions" type="checkbox" required /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
      </label>
      <input type="submit" value="Submit" />
    </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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 35

Please talk to us about how exactly you are stuck.

" Nest the select element (with its option elements) within a label element with the text How did you hear about us? . The text should come before the select element."

that’s what i’ve been asked to do and i dont know where is the problem

Copy-pasting the instructions doesn’t really help. What word are words don’t you understand? What about the error message don’t you understand.

‘fix it for me’ doesn’t give us much to work with.

that’s the code before the changes:

<fieldset>
    <label>Upload a profile picture: <input type="file" /></label>
    <label>Input your age (years): <input type="number" min="13" max="120" /></label>

    <label for="countryDropdown">Select your country:
        <select id="countryDropdown" name="country">
            <option value="usa">USA</option>
            <option value="canada">Canada</option>
            <option value="uk">UK</option>
            <option value="australia">Australia</option>
            <option value="other">Other</option>
        </select>
    </label>
</fieldset>

i’benn asked to do this: Nest the select element (with its option elements) within a label element with the text How did you hear about us? . The text should come before the select element.

and the error is: You should give the label element the text How did you hear about us?

Ok, you don’t seem to understand what I’m asking for. I am hoping that you can use your own words and talk about why you are stuck instead of copy-pasting stuff at me.

Communication is a critical coding skill and you talking with me makes it much easier to zero in on your misunderstanding.

i don’t understand where is the error.
i changed the text in the label to “How did you hear about us?” as i’ve been asked, but it is not accepted and i just can’t understand why…

All of this code looks completely different than the starting code I see? I would make sure you have the right starting code, beccut the contents aren’t the same, then the tests often can’t find you changes.

Found the solution. Thanks

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