Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:
MY ISSUE IS THAT EVERY TIME I NEED HELP AND I ASK YOU, YOUR SOLUTIONS ARE JUST AS WRONG AS MINE. SO HOW CAN YOU SAY YOU’RE TEACHING WHEN YOUR OWN CODES DON’T EVEN WORK THEMSELVES? LOOK AT MY REGISTRATION FORM’S CODE, IT’S THE SAME AS YOURS BUT YOUR EDITOR SAYS IT’S WRONG.
HOW CAN SOMEONE LEARN AT THAT TYPE OF PROCESS. IN CODE CAMP EVERY THING RIGHT IS WRONG.

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15

Challenge: Learn HTML Forms by Building a Registration Form - Step 31

Link to the challenge:

Hello!

I understand you are very frustrated.

Please do not use all capitals when address us? It is considered yelling.

We, are like you, learning and hoping to share the knowledge and learn.

As I can see the above is not entered correctly.

I think many of us have found this challenging to do. But, it is possible.

Please attempt to correct it by entering the text between the input and the closing label. Then, anchor the terms and conditions, as you have done, only without the spaces between the anchor tags and the terms and conditions.

Example Only

<p>The cat <a href="url">text</a> ran after the mouse.</p>

I hope this helps you move on, and eases your frustration.

Tell us what’s happening:
I did just what you asked and no good, I even put the solution you explained to me , and still no good. I copied the same solution but no go. I will get this no matter what I never really thought this would be easy so I’m ready to deal with it. oh yeah, I didn’t mean to yell I was just trying to figure this out. my bad.

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" <a href="https://www.freecodecamp.org/news/terms-of-service/"I accept the 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;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15

Challenge: Learn HTML Forms by Building a Registration Form - Step 31

Link to the challenge:

1 Like

I am sorry it is so difficult. It can be extremely frustrating.

Please try one thing for me?

Please reset the step to remove any lingering code?

Enter the code with the text between the input and the closing label tag.

Do not add any spaces.

The only thing then is to add the anchor touching the words >terms and conditions<.

No need to add anything except the text and the anchor.

Please, if it does not work, post the updated code for assistance to resolve this and help you move on to the next step?

1 Like

You broke the label element by inserting another element inside of the opening label tag. You can’t put HTML tags inside of other HTML tags.

1 Like

I am very happy you were able to move on to the next step.

Please know the community, as a whole, is here to offer support and guidance.

We all learn and progress together.

Keep up the good progress!

This one was tough!!! Spend an hour to understand my mistake…

JeremyLT,
<label for="terms-and-conditions" is exactly what I have if you can see my code
but when I use yours it’s not working.

I did not move on I’m still having problems with this one, if you have the solution, could you show me so I can see the difference.

I’m not writing any code. I’m telling you what to fix in your code. You need to read what I wrote and fix your code.

We cannot write the answers for you! That’s against the rules.

Please post your full updated code.

@JeremyLT is indeed correct.
Your label element is messed up.
It’ll be easier if you just restart this step.

 <label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /></label>

Now add the text 'I accept the terms and conditions' right AFTER your input element. Be careful to use the correct spacing.
Ex:

<label for=""><input id="" type="" required />#here your gonna add the 'I accept...' text which will appear AFTER your checkbox.</label>

I hope this helps you but please be as kind to everyone as you were to me.
AND DONT STRESS 2 MUCH CAUSE LIFE IS GREAT EVEN THOUGH WE DONT ALWAYS SEE IT :laughing:!

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