Learn HTML Forms by Building a Registration Form - Step 40

Tell us what’s happening:
The instructions for this step are unclear.
" With form submissions, it is useful, and good practice, to provide each submittable element with a name attribute. This attribute is used to identify the element in the form submission.

Give each submittable element a unique name attribute of your choosing, except for the two radio inputs."

Where am I supposed to put the name attributes? I’ve tried putting them in the fieldset elements, the input elements, label elements, and i only get the same hint of " You should give the file a name attribute. PS I would have chosen file" which does not help. I’m using freecodecamp to practice and learn, and i’m so lost.

  **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 action='https://register-demo.freecodecamp.org'>
      <fieldset>
      <label for="first-name">Enter Your First Name: <input id="first-name" name="primary" type="text" required /></label>
      <label for="last-name">Enter Your Last Name: <input id="last-name" name="secondary" type="text" required /></label>
      <label for="email">Enter Your Email: <input id="email" name="internet-id" type="email" required /></label>
      <label for="new-password">Create a New Password: <input id="new-password" name="secret-words" type="password" pattern="[a-z0-5]{8,}" required /></label>
    </fieldset>
    <fieldset>
      <label for="personal-account"><input id="personal-account" type="radio" name="account-type" /> Personal Account</label>
      <label for="business-account"><input id="business-account" type="radio" name="account-type" /> Business Account</label>
      <label for="terms-and-conditions" name="terms-and-conditions">
        <input id="terms-and-conditions" type="checkbox" required name="yes-or-nos" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
      </label>
    </fieldset>
    <fieldset>
      <label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file"/></label>
      <label for="age">Input your age (years): <input id="age" type="number" min="13" max="120" /></label>
      <label for="referrer">How did you hear about us?
        <select id="referrer" name="referrer">
          <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="bio">Provide a bio:
        <textarea id ="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
      </label>
    </fieldset>
    <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; rv:105.0) Gecko/20100101 Firefox/105.0

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

Link to the challenge:

This input doesn’t have a name. That’s what the error is telling you.

1 Like

thanks God, it almost made me mad :crazy_face:

1 Like

Hello!

-The name attribute is the same like the others.
-An attribute is added in the opening tag after the element, such as <p class="first">text</p> or at the end of the opening tag, it does not really matter the order as long as it is inside the opening tag.
-Now just look more carefully for the specific inputs that the step requires you to add the name attribute for. Add any name you want.

Hope this help! :wink:

1 Like

ugh thank you so much. i was so confused by the instructions that I could not understand what they were telling me to do :sweat_smile:

1 Like

No problem! The beginning is always the hardest. Keep it going :muscle:

I’m stuck exactly at the same point. I don’t really get what it want me to do though. I’ve created a post with the code so far, if you could check it and give me a hint or a tip it would be awesome!