Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPhil Jones
13,727 PointsRadio Buttons - Task 1
Hello,
My code isn't passing. Triple checked it. Not sure why. Please advise. :)
<form action="index.html" method="post">
<h1>Shirt Order Form</h1>
<label for="color">Shirt Color:</label>
<select id="color" name="shirt_color">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="purple">Purple</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
<option value="orange">Orange</option>
</select>
<input type=”radio” id=”small” value=”small” name=”shirt_size”>
<button type="submit">Place Order</button>
</form>
4 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Phil,
The quotes around your attribute values for your radio button are the wrong kind of quotes. I'm not sure how you got them. Did you type that line into a word processor maybe and then paste it into the challenge?
If you delete all those slanted quotes and then type a normal straight double quote which is next to the enter key on your keyboard then it will pass.
If you're using a word processor for a text editor then you should switch over to a dedicated text editor like sublime text.
Stephen Goeddel
11,239 Pointschange the name on your select element from shirt_color
to color
Phil Jones
13,727 PointsHi Stephen,
I made the change you suggested, but it still didn't pass. Here is the code.
<form action="index.html" method="post">
<h1>Shirt Order Form</h1>
<label for="color">Shirt Color:</label>
<select id="color" name="color">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="purple">Purple</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
<option value="orange">Orange</option>
</select>
<input type=”radio” id=”small” value=”small” name=”shirt_size”>
<button type="submit">Place Order</button>
</form>
Thanks for answering!
Stephen Goeddel
11,239 PointsWhat is the specific error you are getting? I noticed that you have a radio with just a singular input, which is odd. If you are only going to have one radio button you should probably just make it a checkbox, but I'm not sure that that is what is causing the error. You also should not have the action set to index.html
as that is not valid, an HTML file is unable to process a form, so that might also be what is causing it to fail.
Phil Jones
13,727 PointsHi Stephen, it seems the problem was the issue pointed out by Jason Anello (below). When I, as he suggested, switched the slanted double quotes for the straight single quotes, the code passed. ;)
Thanks!
Phil Jones
13,727 PointsHi Jason, Switched the double quotes out for the single quotes. It worked!
Thanks