Tell us what’s happening:
Still stuck here i dont know what’s wrong, i think i have placed the text inthe correct place i dont know whats wrong
Your code so far
/* file: index.Ext.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>
<label for="terms-and-conditions"><a href="https:www.freecodecamp.org/news/terms-of-service/"><input id="terms-and-conditions" type="checkbox" required />I accept the terms and conditions </label>
<input type="submit" value="Submit" />
</form>
</body>
</html>
/* file: styles.Ext.css */
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;
}
label {
display: block;
margin: 0.5rem 0;
}
Your mobile information:
SM-A042F - Android 14 - Android SDK 34
Challenge: Learn HTML Forms by Building a Registration Form - Step 31
Link to the challenge:
Teller
February 3, 2025, 9:32pm
2
Hi @Busanathiradebe
Add the text I accept the terms and conditions
immediately after the input
element in the newly added label
. Then link the text terms and conditions
to the following location:
Only a part of the text needs to become a link.
Happy coding
1 Like
I don’t understand what do you mean when you say only a part of the text needs to be a link havent i done that?
Teller
February 3, 2025, 9:54pm
4
Only the last three words are the link text.
The blue text and underline shows that the entire phrase is a link.
1 Like
<label for="terms-and-conditions"><input id="terms-and-conditions" type="checkbox" required />I accept accept terms and conditions</label>
This is the code now it still stays i have to put the text after the input
Teller
February 3, 2025, 11:45pm
6
Here is the original code you posted.
The anchor element has disappeared from your update code.
1 Like
<label for="terms-and-conditions"><a href="https://www.freecodecamp.org/news/terms-of-service"></a><input id="terms-and-conditions" type="checkbox" required />I accept accept terms and conditions</label>
Even when i put the anchor it still says i should put the text immediately after input
@Busanathiradebe Double check the text. It’s have the word accept
twice.
1 Like
<label for="terms-and-conditions"><a href="https://www.freecodecamp.org/news/terms-of-service"></a><input id="terms-and-conditions" type="checkbox" required />I accept terms and conditions</label>
I have removed it but it still saying the samething
Teller
February 4, 2025, 6:13am
10
Hi @Busanathiradebe
I rearranged the code to make it easier to read:
The anchor element is not nesting any text.
The word the
has disappeared.
Happy coding
1 Like
Thank you for the help i appreciate it
1 Like
<label for="terms-and-conditions"><a href="https://www.freecodecamp.org/news/terms-of-service">terms and condition</a><input id="terms-and-conditions" type="checkbox" required />I accept the terms and conditions</label>
I have added the text to the anchor and the but still it saying i must add text immediately after the input eish
JuniorQ
February 4, 2025, 6:49am
14
Hey,
You can check your code in the preview section and see Where you’re doing wrong.
You are using the anchor element in the wrong place. Don’t add a new "terms and conditions " text. Just turn the existing one into a link.
1 Like