Learn HTML Forms by Building a Registration Form - Step 30

Tell us what’s happening:
Hello guys, I’m stuck in here, anyone to kindly show me what I’m doing wrong in this code.
Describe your issue in detail here.

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>

<!-- User Editable Region -->

      <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"><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label>
        <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
      </fieldset>

<!-- User Editable Region -->

      <fieldset></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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

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

Link to the challenge:

You should not have a new terms and conditions text. You should use the existing one in the third label element.

You should use an a element to link to the terms and conditions.
why does it keep on telling me this surely while I’ve used the “a tag”
I dont understand where am I going wrong?

As stephen said. You added this line, and should not have. You need to add the anchor tag around the existing text that the challenge gives you.

<label <a for="terms-and-conditions" href="https://www.freecodecamp.org/news/terms-of-service/"></a><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label>
Still after doing that it didn’t work. Help me kindly I’m lost

What instructions???

This is in addition to the for.

Every submittable element requires a name to match its id so it will be linked to the action. I hope this helps you.

You are trying to use a for in a anchor tag. Thats not how that works. The anchor tags needs to go around the text “terms and conditions” in the challenge

Right now, you are just adding the anchor tag before the actual text.

“To finish this fieldset off, link the text terms and conditions in the third label to the following location:”

I think you are looking at a different challenge. This is all the instructions there are

1 Like

Sorry about that. Thanks for catching my mistake, Cody! I was looking at a different for some reason.

Sorry! I was looking at the wrong step. :face_with_open_eyes_and_hand_over_mouth:
Luckily, Cody has this for you.
Happy coding, Dennis!

Honestly I’m lost, would you mind to just give me an example of what is expected of me, not necessarily a direct answer but a hint to enable me move forward for I’m stuck and I’ve tried my best please.

I would reset the lesson so you can start fresh. When you do you will have this line


<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label>

Your anchor tag needs to start and end here


<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /> I accept the //start tag terms and conditions //end tag</label>

And where do I put the href…?

I think it might be beneficial for you to read up on anchor tags. The href always goes in the opening anchor tag

<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox"/> I accept the terms and conditions// <a href="https://www.freecodecamp.org/new/terms-of-service/">terms and conditions</a> </label>
What could I possibly be doing wrong?

You are still adding the words “terms and conditions” You should not be adding any text in this challenge. The only thing you should be adding is the anchor tags

You should have only added the anchor tags in this line where I added the comments

1 Like

I managed thank you for the help though.

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