Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:

please help. i dont get what’s wrong 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>
      <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 conditons</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

You have a duplicate in your input

<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 conditons
  </a>

It should work once you remove the terms and conditions part that is not in the a element

there is space before your sentence - I accept the terms and conditions

and the terms and conditions part is written twice.

You accidently say terms and conditions twice, remove the one that’s not in the a element

just removed the space, still getting an error.

I accept the terms and conditionsterms and conditons

Yes, and also remove the terms and conditions phrase that is written outside the a tag.

here i modified it but still
I accept the terms and conditons

If it’s not working then, reset the lesson. Add the sentence with the a tag (without any duplication) and try again.

1 Like

Watch out for any spelling errors.

I accept the terms and conditions

i reset it, removed the space before ‘i accept…’ and removed the 'terms and conditions ’ before the opening tag of the a element

still giving an error

can you provide the code here?


i’m not sure how to directly copy the code from my computer to the reply but here is a screenshot

try adding a space after “the” and removing the space before “terms”

you’re a star. it worked. thanks.

1 Like

I was a bit worried there myself :sweat_smile:. I’m glad it worked. Good luck on the path.

1 Like

Hi there! How to share your code properly:
Forum code formatting

<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>
i think  i got it. thanks
1 Like

Yep! But it would be better to move your text from code area