Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:

I have no idea what to do hear ive tried a few times but can’t seem to get it

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" <a terms and conditions https://www.freecodecamp.org/news/terms-of-service/ type="checkbox" required />I accept the terms and conditions</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.5 Safari/605.1.15

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 31

1 Like

This doesn’t look like valid html

1 Like

Also, you should not create a new text, you should instead nest the existing piece of text.

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

this is my interpretation but its still jumbled in my brain

1 Like

I don’t really understand how to put a link only for terms and conditions

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

If you review the cat photo app step 11-14 I think you can see how to do that there.

You can also search on google for “how to create an html link” if you forgot how to use the anchor tag.

Tell us what’s happening:

having troubles with this question made a post before but didn’t make It clear enough to what I was asking sorry.

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 <a href="https;//www.freecodecamp.org/news/terms-of-service/"</a>terms and conditions</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.5 Safari/605.1.15

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 31

  • You missed the > in the opening tag <a>
  • The text terms and conditions must be between the opening tag<a> and the closing tag </a>
1 Like

I tried that it just said that “You should give the a element an href of `freeCodeCamp's Terms of Service”.

Please post the updated code.

Remember to put your code between 2 lines of 3 backticks ( ` ), like this:

```
# your code here
```

or use the Preformatted Text button (the one with the </> symbol) :

` The backtick key is usually right under the Escape key on your keyboard.

Try this
I accept the

can someone post what the code should look like for what the question is asking?

Hi @markmanojlovic5

There are a few bugs in your code.

  1. After https you need a colon, not a semi-colon
  1. The anchor opening tag is missing a closing angular bracket at the end.
  1. The anchor closing tag goes after the word conditions

Happy coding

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

This is my code so far still saying after fixing up the mistakes and resetting it that  I should  "You should add `I accept the terms and conditions` text to the label following the third fieldset."

the tag needs to end before the text, the text of the anchor element has to be between the <a> opening tag and the </a> opening tag

I tried that and I’m still having problems ill post the whole code and see what everyone think I don’t know why its so hard for me
<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required />I accept the <a "href://www.freecodecamp.org/news/terms-of-service/"</a> terms and conditions></a></label>

you have written this as the whole tag, the text terms and conditions has to be out of the tag

also,, you have written the href wrong, it needs to be like this: href=“url”

from here, the tag has to end with just >, remove the </a part

remove the >

  <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/"></a> terms and conditions</label>

how’s this looking I have read it over again and changed a few things