Learn HTML Forms by Building a Registration Form - Step 30

I am trying to link the text “terms and conditions” with the URL for freecodecamp but for some reason, it isn’t working.

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>

<!-- User Editable Region -->

      <fieldset>
        <label for="personal-account"><input id="personal-account" type="radio" name="account-type" /> Personal Account</label>
        <label for="business-account"><input id="business-account" type="radio" name="account-type" /> Business Account</label>
        <label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required /> I accept the terms and conditions</label><a href="https://www.freecodecamp.org/news/terms-of-service/" target="_blank">terms and conditions</a>
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58

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

Link to the challenge:

Welcome to our community!

Where did you find the instruction to add another text “terms and conditions”?

Restart step.

In the existing sentence, surround only the words “terms and conditions” with anchor tags. There is no instruction to add the target attribute and its value.

Where it says, I accept the terms and conditons, that’s for a checkbox with the text, “I accept the terms and conditions”. Then under that, the words, terms and conditions, is supposed to be the link. As far as I know isn’t this how you do that, terms and conditions . Even when I remove the target attribute it still doesn’t work. I am really confused, I know it’s something I am doing wrong, I just can’t see it

Post your code here.

I accept the terms and conditions
terms and conditions

Use the <\> button in your editor to format code properly. This way, we cannot help.

I am new at this. I am going through Great Learning, but not getting the help I need so coming to freecodecamp to supplement my learning

I am using those. I copied the code and pasted there but that is all it is showing. I don’t know any other way to send my code here

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 (').

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

Thanks for the help there

1 Like

As I have already said, the code line shown here is the one in which you have to surround the words “terms and conditions” with anchor tags. The second code line is not requested in this challenge. Delete it.

But that is not what step 30 told me to do. The checkbox for the words, I accept terms and conditions is separate from the link terms and conditions. They are two different elements

The instruction: "To finish this fieldset off, link the text terms and conditions in the third label to the following location:

https://www.freecodecamp.org/news/terms-of-service/

link the text terms and conditions in the third label to the following location…

and this is the third label element:

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

I tried that and it is not working

Now, you have surrounded the whole text in the third label with the anchor tags:

<a href="https://www.freecodecamp.org/news/terms-of-service/"> I accept the terms and conditions</a>

Surround only the words “terms and condition” in the sentence “I accept the terms and conditions” with the anchor tags.

It worked and I did not know you could do that. Thank you so much and sorry it took me a minute to get it. Thank you again

1 Like

Where do I go to learn to do this- Step 38

Link the applicable form elements and their label elements together.

Use profile-picture, age, referrer, and bio as values for the respective id attributes.

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