I dont get this. Please help me!!

Joined
Jan 24, 2023
Messages
1
Reaction score
0
Hi guys! I´m new a this and i've been stuck with this for almost a week.
I've been practicing at freeCodeCamp and this are the last two tasks that I cannot solve:
  • Failed: All your radio buttons should have a name attribute and value.
  • Failed: Every radio button group should have at least 2 radio buttons.
I´d be so grateful if anyone could help me.

Here is what I wrote:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<title>freeCodeCamp Survey Form</title>
</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>
<div class=".fieldset">
<form id="survey-form" name="survey-form">
<fieldset>
<label id="name-label">Name<br>
<input id="name" type="text" placeholder="Juan Pepe" required=""></label><br>
<br>
<label id="email-label">Email<br>
<input id="email" type="email" placeholder="(e-mail address removed)" required=""></label><br>
<br>
<label id="number-label">Age<br>
<input id="number" type="number" min="0" max="120" placeholder="0"></label><br>
<br>
<br>
<label>Which option best describes your current role?<br>
<select name="dropdown" id="dropdown">
<option name="0" value="">
Select an option
</option>
<option name="challenge" value="1dd">
Challenges
</option>
<option name="name" value="2dd">
Projects
</option>
<option name="ssc" value="3dd">
ssc
</option>
</select></label><br>
<br>
<br>
<label id="group1" name="group1" value="RadioV1">Would you recommend freeCodeCamp to a friend?<br>
<br>
<label name="eso">Definitely<input type="radio" name="radiobutton1" value="rb1"></label><br>
<label name="esa">Not sure<input type="radio" value="rb2"></label><br>
<br>
<br></label> <label name="x" value="label-checkbox">What would you like to see improved?<br>
<br>
<label><input name="cb1" type="checkbox" value="1">Front-end Projects</label><br>
<label><input name="cb2" type="checkbox" value="2">Back-end Projects</label><br>
<label><input name="cb3" type="checkbox" value="3">Data Visualization</label><br>
<label><input name="cb4" type="checkbox" value="4">Challenges</label><br>
<label><input name="cb5" type="checkbox" value="5">Open Source Community</label><br>
</label><br>
<br>
<label id="groupo2" name="group2">Label<br>
<br>
<label>holaaa <input type="radio" name="radiov2" value="radioV2"></label><br>
<label>holaa <input type="radio" name="radiov3" value="radioV3"></label><br>
<label>hola <input type="radio" name="radiov4" value="radioV4"></label></label><br>
<br>
<label>Any comments or suggestions?<br>
<textarea cols="70" rows="7" placeholder="Enter your comment here..."></textarea><br>
<br>
<br></label> <input id="submit" type="submit" class="submit">
</fieldset>
</form>
</div>
</body>
</html>

Thanks for helping me.
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
Your second radio button does not have a name
<label name="esa">Not sure<input type="radio" value="rb2"></label><br>

Radio buttons group must share the same name to be grouped together. You have different name for all your buttons,
 
Joined
Jan 30, 2023
Messages
107
Reaction score
13
The errors are because you have not specified the name and value attributes for some of the radio buttons and some of the radio button groups have only one radio button. Here is the corrected code:

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<title>freeCodeCamp Survey Form</title>
</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>
<div class=".fieldset">
<form id="survey-form" name="survey-form">
<fieldset>
<label id="name-label">Name<br>
<input id="name" type="text" placeholder="Juan Pepe" required=""></label><br>
<br>
<label id="email-label">Email<br>
<input id="email" type="email" placeholder="[email protected]" required=""></label><br>
<br>
<label id="number-label">Age<br>
<input id="number" type="number" min="0" max="120" placeholder="0"></label><br>
<br>
<br>
<label>Which option best describes your current role?<br>
<select name="dropdown" id="dropdown">
<option name="0" value="">
Select an option
</option>
<option name="challenge" value="1dd">
Challenges
</option>
<option name="name" value="2dd">
Projects
</option>
<option name="ssc" value="3dd">
ssc
</option>
</select></label><br>
<br>
<br>
<label id="group1">Would you recommend freeCodeCamp to a friend?<br>
<br>
<label>Definitely<input type="radio" name="group1" value="Definitely"></label><br>
<label>Not sure<input type="radio" name="group1" value="Not sure"></label><br>
<br>
<br></label> <label id="group-checkbox">What would you like to see improved?<br>
<br>
<label><input name="cb1" type="checkbox" value="1">Front-end Projects</label><br>
<label><input name="cb2" type="checkbox" value="2">Back-end Projects</label><br>
<label><input name="cb3" type="checkbox" value="3">Data Visualization</label><br>
<label><input name="cb4" type="checkbox" value="4">Challenges</label><br>
<label><input name="cb5" type="checkbox" value="5">Open Source Community</label><br>
</label><br>
<br>
<label id="group2">What type of person are you?<br>
<br>
<label>Type A<input type="radio" name="group2" value="Type A"></label><br>
<label>Type B<input type="radio" name="group2" value="Type B"></label><br
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,057
Messages
2,570,443
Members
47,113
Latest member
XZJMike318

Latest Threads

Top