Failed:You should have a form
element with an id
of survey-form
.
<h1 id="title">freeCodeCamp Survey Form</h1>
<p id="description">Thank you for taking the time to help us improve the platform</p>
**<form id="survey-form">**
<fieldset>
<label for="name" id="name-label">Name
Hey everybody, i get this error massage and i don’t understand it.
Please share all the code, not just a snippet.
Reason for this error may be that you have duplicate ids or invalid html.
i made a mistake and i dont know how to post the code again.
Read this:
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 (').
So i try again: Failed:You should have a form
element with an id
of survey-form
.
I don’t understand the problem.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf8">
<title id="survey-form">Survey Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 id="title">freeCodeCamp Survey Form</h1>
<p id="description">Thank you for taking the time to help us improve the platform</p>
<form id="survey-form">
<fieldset>
<label for="name" id="name-label">Name
<input id="name" name="name" type="text" placeholder="Enter your name" class="eingabekontakt" required></label>
<label for="email" id="email-label">Email
<input id="email" name="email" type="email" placeholder="Enter your Email" class="eingabekontakt" required></label>
<label for="number" id="number-label">Age (optional)
<input id="number" name="age" type="number" placeholder="Age" min="10" max="99" class="eingabekontakt" required></label>
</fieldset>
<fieldset>
<label for="dropdown" id="firstselect" >Select current role
<select id="dropdown" name="current role">
<option value="">(select current role)</option>
<option value="1">Student</option>
<option value="2">Full Time Job</option>
<option value="3">Full Time Learn</option>
<option value="4">Prefer not to say</option>
<option value="5">Other</option>
</select>
</label>
</fieldset>
<fieldset>
<label for="recommended" id="recommended" class="labelWould">Would you recommended freeCodeCamp to a friend?</label>
<input id="recommended" name="friend" type="radio" value="definitely" checked class="radiorecommended"> Definitely
<label for="recommended" id="">
<input id="recommended" name="friend" type="radio" value="maybe" class="radiorecommended"> Maybe
</label>
<label for="recommended">
<input id="recommended" name="friend" type="radio" value="not sure"class="radiorecommended"> Not sure
</label>
</fieldset>
<fieldset>
<label for="favorite feature" >What is your favorite feature of freeCodeCamp?
<select id="favorite feature" name="favorite feature">
<option value="">(select an option)</option>
<option value="1">Challenges</option>
<option value="2">Projects</option>
<option value="3">Community</option>
<option value="4">Open Source</option>
</select>
</label>
</fieldset>
<fieldset>What would you like to see improved?
<label for="front" class="checkimproved">
<input id="front" name="checkapply" type="checkbox" value="Front-end Projects"required> Front-end Projects
<label for="back" class="checkimproved">
<input id="back" name="checkapply" type="checkbox" value="Back-end Projects" required> Back-end Projects
<label for="data" class="checkimproved">
<input id="data" name="checkapply" type="checkbox" value="Data Visualization" required> Data Visualization
<label for="challenges" class="checkimproved">
<input id="challenges" name="checkapply" type="checkbox" value="Challenges" required> Challenges
<label for="open" class="checkimproved">
<input id="open" name="checkapply" type="checkbox" value="Open Source Community" required> Open Source Community
<label for="gitter" class="checkimproved">
<input id="gitter" name="checkapply" type="checkbox" value="Gitter help rooms"required> Gitter help rooms
<label for="videos" class="checkimproved">
<input id="videos" name="checkapply" type="checkbox" value="Videos" required> Videos
<label for="city" class="checkimproved">
<input id="city" name="checkapply" type="checkbox" value="City Meetups" required> City Meetups
<label for="wiki" class="checkimproved">
<input id="wiki" name="checkapply" type="checkbox" value="Wiki" required> Wiki
<label for="forum" class="checkimproved">
<input id="forum" name="checkapply" type="checkbox" value="Forum" required> Forum
<label for="courses" class="checkimproved">
<input id="courses" name="checkapply" type="checkbox" value="Additional Courses" required> Additional Courses
</label>
</fieldset>
<fieldset>
<label for="comments" id="suggestion">Any comments or suggestions
<textarea id="comments" maxlength="65" placeholder="Enter your comment here ..."></textarea>
</label>
</fieldset>
<input type="submit" id="submit" name="submit" value="submit" class="submitbutton">
</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 (').
ok thanks a lot.
And i find the mistake. I set the same id at the title and at the form. I delete it at the title and it runs.
thanks
In future please do not create a duplicate topic for the same challenge. I have merged your duplicates.
system
Closed
April 17, 2023, 2:17am
10
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.