Learn HTML Forms by Building a Registration Form - Step 31

Tell us what’s happening:

I did set the terms and conditions as requested , the link is blue and working but the code doesn’t pass trough the test

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 terms and conditions</label>
    <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a> <br><br>


<!-- 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 (iPad; CPU OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/122.0.6261.62 Mobile/15E148 Safari/604.1

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 31

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!

the words here terms and conditions have to become a link, do not write them again

I did set the terms and conditions as an anchor “a “ but it doesn’t pass through even that the link is working

this the content of your label and I don’t see any anchor element here

Underneath the label and input I wrote this : [quote=“tonistardust111, post:1, topic:675179”]
<a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
[/quote]

As I said, you need to make the text ‘terms and conditions’ that is inside the label into a link

Where please, ? Because I’d try many ways and nothing happens …. :pray: Thanks

the words terms and conditions here should be a link

<!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>
      <label for="terms-and-conditions" <a href:="https://www.freecodecamp.org/news/terms-of-service/"></a> /*it doesn’t work */
      <input id="terms-and-conditions" type="checkbox" required />I accept the terms and conditions</label>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

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

1 Like

your label is missing a closing angular bracket

this is not how you give a value to an attribute, use only =, not :=

the anchor element is empty, so it’s like it’s not there

the words terms and conditions are not a link

Oh , I didn’t know that, it’s my first time posting something here … thank u

I’m coding with an iPad and it’s too sensitive and sometimes a typo can happens , I know how to use ( : ) and ( = ) … I’m sorry.
Could you please show me how it should look this part of the code ? I did try everything and still not working ….thank u

can you post your code here again?

or maybe you can reset the code and do it again from the begginning by pressing reset button below check your code(don’t worry it won’t reset from the start).
ill explain the instruction.

so what you need to do is add I accept the terms and conditions text after this code

and then you need to make the text “terms and conditions” into a link by using anchor element “a” which is like this <a href="Your Link Goes Here">Text Goes Here</a>

also make sure there are no typo and the code should pass
Hope this help!

1 Like

I just found out how to repair it , thank u :pray:

1 Like