Learn HTML Forms by Building a Registration Form - Step 31

Describe your issue in detail here.
There is some mistake I am making with my code in the place with the and the . Can’t figure out quite what the problem is, so I’d appreciate the help :slight_smile:

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">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>

<!-- 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;
}

I can’t put elements in my text it seems. So the A element and the label element, I am having trouble there.

Do you mean inputting characters texts in your element or adding text to your element in such example of “<>example</>”

Ahah, in my title text, that just means when I create this post I can’t create an element in my request for example <.a> has to be said I think. No, my problem is with my code, it looks like it’s been done perfectly, but, code camp says I have made a mistake.

Alright, I haven’t exactly figured it out, but, input id=“terms-and-conditions” type=“checkbox” required / I accept the a href=“freeCodeCamp's Terms of Service”>terms and conditions /a this is the correct code, when you add < or >. I don’t know what I did wrong. Anyway, resolved.

1 Like

Indeed see the problem. The input label was put in the wrong spot . You wrote the code correctly but the placements were incorrect. Glad you found the solution! Cheers mate

2 Likes

Thankyou for looking into it :smiley:

2 Likes

I am having the same issue, I don’t understand your solution

I accept theterms and conditions
why is this code not working

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