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

Daniel C. Avery
Daniel C. Avery
11,617 Points

The right answer is not accepted. I put: <button type="submit">Place Order</button> and it says "Bummer!" Why?

I'm on the last task of the first code challenge in the last section of Nick Pettit's HTML Forms course. I put in the right code as requested and it will not accept the right answer. I listed my code above. This is just what is asked for. Is there a bug?

Thanks!

index.html
<!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>
      <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>
        <button type="submit">Place Order</button>
    </form>

  </body>
</html>

3 Answers

Anthony Babich
Anthony Babich
5,505 Points

Hi,

You're missing the closing /select, which is why I'm assuming treehouse compiler is overlooking the "button" because it hasn't finished the select statement. I went through the course just to verify and yep that was it.

The only reason it worked when you moved it to the top, was because the verification if that test was complete is probably only searching for the addon of a button.

<!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>
      <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>
        <button type="submit">Place Order</button>
    </form>

  </body>
</html>
Daniel C. Avery
Daniel C. Avery
11,617 Points

OK, Wow. How'd I miss that? Thanks a lot, that would never have occurred to me, because it took me a minute to even realize what you meant. LOL Thanks again!

Daniel C. Avery
Daniel C. Avery
11,617 Points

Sorry, clarification.

The task said: "Add a submit button to the form." As far as I can tell, I did that at the bottom. Is there a bug? Thanks!

Daniel C. Avery
Daniel C. Avery
11,617 Points

Never mind, it wanted the button at the top of the form instead of the bottom. Go figure.

Douglas Counts
Douglas Counts
10,126 Points

Sorry, you had a problem with the quiz. You can put the button wherever you like within the workspaces to test things out. But on the graded exercises, you need to follow their instructions or the quiz parser will not detect whether your answer is correct. I mean how can it? There are unlimited ways to do most programming tasks and I'm sure you wouldn't want to wait for hours while it tested every one of them, if that is even possible at all. You don't even need a form element to submit data to a server because you can use JSON requests instead, for example, to accomplish the same thing. So how could the quiz parser check a working solution but where the user removed the very HTML Form Element that it was looking for? See what I mean?

Good luck...