# Learn HTML Forms by Building a Registration Form - Step 39

**URL:** <https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558>\
**Category:** Curriculum Help\
**Created:** [January 30, 2024, 9:09pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558 "2024-01-30T21:09:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![skureshi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skureshi/32/286049_2.png) [@skureshi](https://forum.freecodecamp.org/u/skureshi)\
**Post date:** [January 30, 2024, 9:09pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/1 "2024-01-30T21:09:48Z")

</div>

### Tell us what’s happening:

Describe your issue in detail here.  
I can’t get past this step 39. Not sure how to write this piece of code

### Your code so far

```html
<!-- 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>How did you hear about us?
          <select>
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label>Provide a bio:
          <textarea></textarea>
          profile-picture<input for="profile-picture" type="text" id="profile-picture">
          age<input for="age" type="text" id="age">
          referrer<input for="referrer" type="text" id="referrer">
          bio<input for="bio" type="text" id="bio">
        </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>

```

```css
/* 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/120.0.0.0 Safari/537.36`

### Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 39

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-39)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [January 30, 2024, 9:09pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/2 "2024-01-30T21:09:49Z")

</div>

You appear to have created this post without editing the template. Please edit your post to **Tell us what’s happening** in your own words.  
Learning to describe problems is hard, but it is an important part of learning how to code.  
Also, the more you say, the more we can help!

---

<div class="post-metadata">

**Author:** ![skureshi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skureshi/32/286049_2.png) [@skureshi](https://forum.freecodecamp.org/u/skureshi)\
**Post date:** [January 30, 2024, 9:11pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/3 "2024-01-30T21:11:58Z")

</div>

![image](https://global.discourse-cdn.com/freecodecamp/original/4X/a/3/3/a3334d66fecffd588bfd11f5d7d2a176e9693f09.png)

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [January 30, 2024, 9:23pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/4 "2024-01-30T21:23:10Z")

</div>

Welcome to the forum @skureshi

You appear to have created new _elements_.

The instructions are asking you to link the _label_ elements to its respective nested element.

This occurs by placing a _for_ attribute in the label element, and an _id_ attribute in the nested element. The attribute value for each link should match. The values are mentioned in the instructions.

Happy coding

---

<div class="post-metadata">

**Author:** ![skureshi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skureshi/32/286049_2.png) [@skureshi](https://forum.freecodecamp.org/u/skureshi)\
**Post date:** [May 29, 2024, 8:33pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/5 "2024-05-29T20:33:01Z")

</div>

Hi, my code is still not working… please help…  
This is what it is saying now  
'The first `input` element should have an `id` of `profile-picture` .

 Upload a profile picture: Input your age (years): How did you hear about us? (select one) freeCodeCamp News freeCodeCamp YouTube Channel freeCodeCamp Forum Other Provide a bio:\<input id="Bio"

---

<div class="post-metadata">

**Author:** ![skureshi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skureshi/32/286049_2.png) [@skureshi](https://forum.freecodecamp.org/u/skureshi)\
**Post date:** [May 29, 2024, 8:41pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/6 "2024-05-29T20:41:54Z")

</div>

### Tell us what’s happening:

I have tried to fix this step a few times and taken help from the forum but it is still not passing. This is the error message " The first `input` element should have an `id` of `profile-picture` ."

### Your code so far

```html
<!-- 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 for>Upload a profile Picture:<input id="profile picture" type="file"/></label>
        <label for>Input your age (years): <input id="age" type="number" min="13" max="120" /></label>
        <label for>How did you hear about us?
          <select>
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label for>Provide a bio:<input id="Bio"
          <textarea></textarea>
        </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>

```

```css
/* 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/125.0.0.0 Safari/537.36`

### Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 39

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-39)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Rwaka](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rwaka/32/339902_2.png) [@Rwaka](https://forum.freecodecamp.org/u/Rwaka)\
**Post date:** [May 29, 2024, 9:04pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/7 "2024-05-29T21:04:52Z")

</div>

Hello @skureshi,

I noticed some issues with the code you shared. Let’s go through and fix them step by step:

1. **First Label** :

- The `label` element is missing the `for` attribute.
- The `input` element’s `id` should not contain spaces. Use a hyphen instead.

1. **Second Label** :

- The `label` element is missing the `for` attribute.

1. **Third Label** :

- The `label` element is missing the `for` attribute.
- The `select` element is missing. Add it with an appropriate `id`.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [November 28, 2024, 8:42am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-39/668558/8 "2024-11-28T08:42:26Z")

</div>

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