Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:

hello again. where am i supposed to insert the text?

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 terms and conditions <a href="https://www.freecodecamp.org/news/terms-of-service/"/>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/123.0.0.0 Safari/537.36

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 31

Hi there, the text I accept the terms and conditions should go directly after the input element.

After adding the text, you need to turn the newly typed terms and conditions into a link that points towards https://www.freecodecamp.org/news/terms-of-service/.

I hope this helps.

1 Like

hello, im sorry im still stuck, i dont understand what your saying, didnt i already make the link for the terms and conditions?
and also the text isnt working either, i placed it at every possible position, yet it doesn’t get accepted. Please advice :smiley:

isn’t the usage of “href” to make it a link correct?

I accept the terms and conditions terms and conditions…this is my code

This code is nearly correct, however if you notice in the preview you get the text I accept the terms and conditions terms and conditions instead of I accept the terms and conditions.

You should delete the extra terms and conditions which is not in the anchor element.


Your anchor element(including the href) is correct.

im sorry man, im still not getting it through…

Please post your current code.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

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

this would be the correct code
solution removed by moderator

and output willl be :
solution removed

hi, it still doesnt work, i even tried pasting ur code

Paste it here…what you are typing

solution removed

this is the correct code and it works for me

well, still it honestly doesn’t work for me

WHOLE HTML

solution removed by moderator

Hello! Its great that you have figured it out, but please do not post the solution. One should be allowed to understand what they are doing. By giving them the solution, they will not understand, and will remain confused.

I removed your answer

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Please post your new code of what you have tried so we can help you

Hello, heres my code :slight_smile:

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

This is what your code currently produces in the preview window

You see how it says terms and conditions twice?
Screenshot 2024-04-15 at 4.38.39 AM

that is incorrect.

you shouldn’t duplicate terms and conditions twice

once you fix that, then the test should pass.

You will know if you have done it correctly when the output looks like this in the preview window

Screenshot 2024-04-15 at 4.39.42 AM

1 Like

oh thank you so much, legit just deleting a few words got it right!

1 Like