Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:

I am stuck in my project, I don’t know what to do.
I am at step 31 of Learn HTML Forms by building a Registration Form.

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>
      <fieldset></fieldset>

<!-- User Editable Region -->

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

<!-- User Editable Region -->

      <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/124.0.0.0 Safari/537.36

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 31

1 Like

Hello there.

Your code has some syntax errors that need to be resolved.
Get rid of this anchor element, you do not need it, you already have the right one

This as well, is before the closing label tag.

This href value is open but not closed, close it with the appropriate quotation mark.

Finally, between your remaining anchor element have the terms and conditions text you deleted.

1 Like

Please can you elaborate further? where should I delete the the terms and conditions text?,Which of them?

Hello @Yawa20 ,

@stephenmutheu has pointed out that your anchor element (<a></a>) is not constructed correctly. Essentially, you have created a “a terms and conditions” element which is incorrect. Fix that and then move on to the remaining items he suggested.

Have a look at this great resource: anchor elements

Does this help?

Keep up the good progress!

Happy Coding! :slightly_smiling_face:

Which part do you want further elaboration on?

Hey there!
You added too many anchor elements. I would suggest to Reset your challenge.

Add the text I accept the terms and conditions immediately after the input element in the newly added label. Then add anchor (a) opening and closing tags around that part of text terms and conditions. Finally add href attribute and required link value within anchor opening tag.
@Yawa20

I understand what you mean, but because i have alot of anchor elements, I don’t where to apply the corrections.

Please I did it and my code is still not passing,it’s saying I should add anchor element to the link to which i’ve done.

If you have updated your code, kindly post it here.

<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required/>I accept the <a> terms and conditions</a> <a href="https://www.freecodecamp.org/news/terms-of-service/"></a></label>
Here is my code and it’s passing
I don’t know what am not doing right

Hi @Yawa20

So the forum can assist please post your full code.

Use the following method to post code to the forum:

  1. On a separate line type three back ticks.
  2. On a separate line paste your code.
  3. On the last line type three back ticks. Here is a single back tick `

Happy coding

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

Here is is my code.
Thank you @Teller for the help.

I have edited your reply to include your code.

Delete the anchor element that is after the input tag plus the text as well.

Now, you are left with one accomplished anchor element. However, it lacks text. You can either type the text or copy and paste it from the instructions.

Please I don’t see the difference between your edited code and my code, can you tell me?

I haven’t edited your code, I have edited your reply since the code was not being displayed.

Please do you know why my code is not passing?

Post your modified code here, we can’t see your computer screen.
@Yawa20

Thank you @Yawa20 for posting your code.

I edited your code for readability.

Your code has too many anchor tags.

  1. Please remove the anchor tags indicated in the code block above.
  2. Place the anchor opening tag with the href attribute before the word terms

Happy coding