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 trial

HTML HTML Forms Choosing Options Create a Select Menu

what's wrong?

Obj: add the following options to the select menu: red yellow prple blue green and orange. set their value attributes to the same words, but in all lowercase....

coded as follows: <form action="index.html" method="post"> <h1>Shirt Order Form</h1> <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>

when you preview- the drop-down works

Hey Scott,

can you copy paste the code exactly as it appears? What you pasted seems to be the output, but not the actual code.

9 Answers

The values in the value attribute are starting with a capital letter - change them into all lowercase. Also, you forgot the closing <select> tag right after your last option. Like this:

<form action="index.html" method="post">
  <h1>Shirt Order Form</h1>
  <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>
</form>

You have your value attributes beginning with uppercase letters. The code should be like this instead:

'' < option value = "red" > Red </ option > ''

why does it matter for the quiz? if the code is written properly, and displays properly...capitalization should not matter but for athetics

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Scott,

There has to be a standard, if capitalisation was optional browsers would have a lot more work to do, remember someone has to build these browsers and code them to work with the code we write. If they had to worry about some people using capitals and others not that would be like doubling the work they had to do to get the browsers to work with our code.

As for the code challenge, its there to see if you have a grasp of the code, so it expects the code we enter to match the code W3C has laid down in the standards. If the code challenge allowed incorrect code to pass, even it is only a capitalisation error, then you would go on to code and wonder why your website didn't work, then you could blame Treehouse for letting your code validate in the challenge even though it was wrong.

Most of the errors I've seen in the code people post and ask for help with isn't down to the wrong code being used, its a small mistake like missing a colon or something.

My spell check keeps changing the word color to the correct way of spelling it ( colour ) and that keeps catching me out, there has to be a strict standard and whether we agree or not we have to follow it and schools such as Treehouse have to teach to those standards too.

idan ben yair
idan ben yair
10,288 Points

Hi Scott, can you please post your code?

fail- you don't seem to have an <option> element where the value attribute is set to "red". Please add one.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <body>

<form action="index.html" method="post">
  <h1>Shirt Order Form</h1>
  <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> 

</form>

</body> </html>

the closing should not allow for the display to be correct when you preview...correct?

you'll need to have the closing tag. The interface is probably complaining because "Red" is not "red" (lowercase R). Try that.

while in some situations the "capital" letters should matter- having a code-checker, the functionality works...i mean this is MY program, correct?

It's probably just the way the quiz works when checking to make sure you did it correctly.

thanks though- that is what makes me get soooooooo frustrated!

the label code is missing