Tell us what’s happening:
step 40 with checkbox and having to add a value to it. I added a value as shown below and it is not letting me complete it. How do I fix my code for my checkboxes now?
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<h1 id="title" >Car Rankings Form</h1>
<title>Car Rankings Form</title>
<link rel="stylesheet" href="styles.css" />
<p id="description" >This form helps us to better understand your preferences</p>
<form id="survey-form" id="number">
<fieldset>
<label for="name-label" id="name-label">Enter Your Name: <input id="name" name="name-label" type="text" required placeholder="#name" /></label><br>
<label for="email" id="email-label">Enter Your Email: <input id="email" name="email" type="email" required placeholder="#email"/></label><br>
<label id="number-label" for="age">Age <input type="number" id="number" name="number" min="13" max="120" required placeholder="Enter Your Age"></label><br>
</fieldset>
<fieldset>
<legend>Type</legend>
<label for="american-european-japanese"><input id="american-european-japanese" type="radio" name="type" class="inline" checked value="1"/> American</label>
<label for="american-european-japanese"><input id="american-european-japanese" type="radio" name="type" class="inline" value="2"/> European</label>
<label for="american-european-japanese"><input id="american-european-japanese" type="radio" name="type" class="inline" value="3"/> Japanese</label>
</fieldset>
<fieldset>
<legend>Select a car</legend>
<select id="referrer" name="referrer">
<select id="dropdown">
<select id="dropdown"><option value="">(select one)</option>
<option value="1">DODGE CHALLENGER SRT HELLCAT News</option>
<option value="2">CHEVROLET CORVETTE ZR1 2009</option>
<option value="3">PORSCHE 911 992 GT3 RS</option>
<option value="4">BMW M5 CS</option>
<option value="5">MERCEDES-BENZ CLS63 AMG S</option>
<option value="6">HONDA NSX 1990</option>
<option value="7">TOYOTA SUPRA MK4</option>
<option value="8">OTHER</option>
</select>
</fieldset>
<fieldset>
<legend>Car?</legend>
<label><input type="checkbox" id="race" name="car?" value="race">Race</label>
<label><input type="checkbox" id="drift" name="car?" value="drift?">Drift</label>
<label><input type="checkbox" id="show" name="car?" value="show">Show</label>
<textarea placeholder="Tell us why?"></textarea>
</fieldset>
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
</label>
<input id="submit" type="submit" value="Submit" />
</head>
</form>
<body>
</body>
</html>
/* file: styles.css */
h1 {
margin: 2.5em;
height: 100vm;
text-align: center;
font-family: Tahoma;
color: white;
}
p {
text-align: center;
font-family: Georgia;
color: white;
}
body {
background-color: #151B54;
color: white;
}
fieldset {
border: none;
margin: 3em;
padding: 2em;
border-bottom: 3px solid grey;
}
legend {
margin-left: 1.5em;
}
form {
width: 60vw;
max-width: 500px;
min-width: 300px;
margin: 0 auto;
padding-bottom: 2em;
}
label {
font-family: Helvetica;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Challenge Information:
Survey Form - Build a Survey Form