[Solved] Survey form labels error

Hello! I completed Survey form. All tests passed except label ids.
Here is an error:

  1. For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: id=“name-label”, id=“email-label”, and id=“number-label”.

Here is a code:

<header>
		<h1 id="title">
			Survey form
		</h1>
	</header>
	<main id="form-area">
		<p id="description">Let us know how we can improve freeCodeCamp</p>
		<form action="" id="survey-form" method="POST">
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label for="name-label">* Name: </label>
					</div>
					<div class="column-75">
						<input type="text" name="name" id="name" placeholder="Enter your name..." required/>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label for="email-label">* E-mail: </label>
					</div>
					<div class="column-75">
						<input type="email" name="email" id="email" placeholder="Enter your e-mail..." required/>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label for="number-label">* Age: </label>
					</div>
					<div class="column-75">
						<input type="number" min="1" max="100" name="age" id="number" placeholder="Enter your age..." required/>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label for="dropdown-label">You are now: </label>
					</div>
					<div class="column-75">
						<select name="job" id="dropdown">
							<option value="Student">Student</option>
							<option value="Full time job">Full time worker</option>
							<option value="Full time learner">Full time learner</option>
							<option value="Other">Other</option>
						</select>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label>* Would you recommend freeCodeCamp to a friend?</label>
					</div>
					<div class="column-75">
						<label><input type="radio" name="sharing" value="Definitely"> Definitely</label><br/>
						<label><input type="radio" name="sharing" value="Maybe"> Maybe</label><br/>
						<label><input type="radio" name="sharing" value="Not sure"> Not sure</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label>What programming languages are you learning?</label>
					</div>
					<div class="column-75">
						<label><input type="checkbox" name="language" value="Java">Java</label><br/>
						<label><input type="checkbox" name="language" value="Javascript">Javascript</label><br/>
						<label><input type="checkbox" name="language" value="Go">Go</label><br/>
						<label><input type="checkbox" name="language" value="PHP">PHP</label><br/>
						<label><input type="checkbox" name="language" value="C++">C++</label><br/>
						<label><input type="checkbox" name="language" value="Kotlin">Kotlin</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div id="form-input">
					<div class="column-25">
						<label>Comment:</label>
					</div>
					<div class="column-75">
						<textarea name="comment" id="comment">Enter your comment...</textarea>
					</div>
				</div>
			</div>
			<center><button type="submit" id="submit">Send</button></center>
		</form>
	</main>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

I’m going to help you with only 1 and it’s up to you to complete the others:

  1. In the label of the email, there should be an id and there’s no attribute id in the label of your email input.
  2. the for attribute inside the label should be the same as the id of the input. So for example, if you gave the name of email to the id of your email input, then you should also give the name of email to the for of its label: for="email"

I hope this was helpful
and Good Luck.

1 Like

Thank you very much! It works :upside_down_face:

Mr. javlonbek, you’re welcome! :+1:

I still can’t understand :frowning: