Learn HTML Forms by Building a Registration Form - Step 26

Tell us what’s happening:
Describe your issue in detail here.
What am I missing? I encased the “terms and conditions” in the a element. the href element has its attribute in quotations. Did I place the a anchors <> in the right place?

   **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html>
 <head>
   <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 action='https://register-demo.freecodecamp.org'>
     <fieldset>
       <label>Enter Your First Name: <input type="text" required /></label>
       <label>Enter Your Last Name: <input type="text" required /></label>
       <label>Enter Your Email: <input type="email" required /></label>
       <label>Create a New Password: <input type="password" pattern="[a-z0-5]{8,}" required /></label>
     </fieldset>
     <fieldset>
       <label><input type="radio" name="account-type" /> Personal Account</label>
       <label><input type="radio" name="account-type" /> Business Account</label>
       <label><input type="checkbox" required /> I accept the <a terms and conditions href="https://www.freecodecamp.org/news/terms-of-service/"> </a> </label>
     </fieldset>
     <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/103.0.5060.114 Safari/537.36 Edg/103.0.1264.49

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

Link to the challenge:

Hi!

I advise you read this article on the anchor element. Your syntax for turning text into a link is incorrect.

As the anchor element is covered earlier in the New Responsive Web Design course, it may be an idea to review those lessons if you have forgotten how to write anchor elements.

1 Like

Please do not give coding solutions to other users. I have edited your post to remove the solution.

It is great you have solved this lesson, but giving full solutions does not help people learn.

1 Like

Understood, thanks for the notification!

1 Like

I didnt forget how to write elements, the syntax is confusing. I have it set up where you could click the text and go to the website but it still says the a element needs to be wrapped around the href and text. So is this a bug or shall I keep on the hunt for the answer?

This isn’t a bug, the anchor element needs to be written in the same way every anchor element using text as a link has been written in the course so far. It also needs to be nested inside the label element.

Could you please explain what you find confusing about the syntax specifically? Then I can try to find the right resources to help explain it.

I am thinking the order in which it is put in confuses me most. I’ll go over that link you sent me. I feel like if i read it over well ill get it eventually.

2 Likes

Hi,
You cannot encapsulate terms and conditions in anchor tag. It won’t show in the browser.

okay but that conflicts with the rules it sets out for me. It is asking me to encapsulate the text"terms and conditions"

It asks me to wrap the a e3lement around the text “terms and conditions” and to add an href. I do not understand why I am not able to solve it.

How about I reword the question?

I’ve done this project in its entirety, and I’ve re-done this lesson step with passing code. So I do know the correct answer.

  1. You need to nest an anchor element inside the third label element.

  2. The anchor element must have the href
    https://www.freecodecamp.org/news/terms-of-service/

  3. The text the anchor element must make into a link is the text terms and conditions

what did I not do? Because when I go over it, I see it inside the label element, it has the href, and it turns “terms and conditions” into a link. obviously something is not quite right.

Please show me your current code. I can’t tell what isn’t working without seeing it.

To format your code, surround it by back ticks, or highlight the pasted code and press the button that looks like this </>. The gif below gives a visual demonstration of both of these.

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

Your syntax is right now. :smiley:

But you need to remove the spaces at the start of and the end of the text terms and conditions. The lessons can be picky about extra spaces.

After doing that, your code passes for me.

1 Like

An unreal amount of relief lifted off my shoulders. Those spaces drove me near to insanity!

2 Likes