Learn HTML Forms by building a registration form Step 31

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

Can anyone explain why this code isn’t working?

Please post your full code and a link to the Step. Thanks

<!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>
   <label for="terms-and-conditions">I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/>terms and conditions</a><input id="terms-and-conditions" type="checkbox" required/></label>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

[quote=“Kryze, post:1, topic:648834, full:true”]

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

Can anyone explain why this code isn’t working?

The syntax highlighting here is indicating that something went wrong. Check the end of your url for a "

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

It still won’t work I have been trying it for a week I see no issue with the code

put the input in front of the I accept the text

Thank you!
I was so confused on what the issue was.

1 Like