Learn HTML Forms by Building a Registration Form - Step 30 - Stuck for days now at check code test - known working code for this step still produces the same er

Tell us what’s happening: I must be missing something obvious.

Describe your issue in detail here: I hav e been trying for days now to get past Step 30 in this lesson but cannot. I feel like I have tried every possible permutation of possibilities but but cannot get past the check code test to move on to step 31. Actually, I had this very same problem on Step 31 before, but I completely reset the lesson and started over to see if that would somehow fix the glitch. In my code as I have it here, I have manually closed out the inputs, but I have tried it with the regular notation style and I get the exact same message every time (see below) - I know this cannot by right because to start I DO, in fact, have a label element immediately after the third fieldset element.

Please help! I have been stuck for days now and it is driving me insane. I have read all the old fourm posts, one time I even read an old post where the person code that was identical to mine (that was the time when I was stuck on Step 31, not 30 like I am now after I reset the lesson) and it did not work for me. What I’m I doing wrong if I have known working code that doesn’t work when I have written the exact same code?


The response that I get from the freecodecamp.org page is this:



// running tests You should add anlabel after the third fields element.
You should add an input to the label element.
You should add a type attribute of value checkbox to the input element.
You should add a required attribute to the input element. The input element should have an id of terms-and-conditions. The label element should have a for attribute with a value of terms-and-conditions.
// tests completed


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>

<!-- User Editable Region -->

      <fieldset>
        <label for="terms-and-conditions" ><input id="terms-and-conditions" type="checkbox" required="yes" ></input></label>
      </fieldset>
        <input type="submit" value="Submit" >

<!-- User Editable Region -->

    </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.3.1 Safari/605.1.15

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 30

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!

I did already - see another glitch!

Welcome to the forum @jsanderson

Place the label element below the closing fieldset tag.

Happy coding

1 Like

To start with, I commend you excellent persistence. That’s the sort of person we need to have working in web development. Secondly I want to say that other people slip on this question, just today I helped a situation similar to yours.

The fact is that FCC put the editable region in the wrong place. Your label and everything in it needs to go after the last fieldset, which is below the area you usually are supposed to put your code into. If you do this your code should pass. Does that help? If not, say so and I will make further effort to aid you. :grin:

3 Likes

I see three things in your code. First, your checkbox input should not have a closing tag. It is a self-closing tag. Second, the required attribute doesn’t need a value. So you should remove it. And third, your code should not be nested inside the fieldset element. It should be outside of it and just above the submit button.
Here’s how your code should look now:

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

Hope that helps! :smiley:

A big thanks to both of you! It took a combination of both of your comments to find out what was going wrong. It took a few tries but I eventually got through it.

Much appreciation and thank you for other kind words!

-Jeff

2 Likes

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