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 Form Basics Create a Submit Button

Why the form code does´t validate?

<body> <form action="index.html" method="post"> <input type="text" id="name" name="user_name"> <textarea id="comment" name="user_comment"> <button>Submit Comment</button> </form> </body>

Logan R
Logan R
22,989 Points

Can you please post your code so we can take a look at it? :)

Try to use the code mark-up by wrapping your code with three `.

2 Answers

Hi, I forgot the <textarea> closing tag.

These forums are a bit confusing. I thought I have posted the code, but somewhere on the way it got lost. Guess the UX of the forums should be improved.

Thanks for your answers Stephan

Logan R
Logan R
22,989 Points

Glad you got it fixed!

You need to add three ` before and after your code, or else it won't show up. If you watch the video on right, under "Tips for asking questions" It will explain more about it :)

I thought it might be the closing tags! :) If my answer helped, don't forget to mark it as the best answer.

If the forums just allowed any code to be pasted straight in, then either it would all get parsed/run and we would see all kinds of weird stuff, or we wouldn't have the nice formatting options we get now.

Also check out the <a data-featurette="modal-trigger" data-target="markdown_cheatsheet" href="#" id="featurette-10">Markdown Cheatsheet</a> that is linked just under the post/comment/answer box when writing something on the forums.

Oh and who is Stephan...?

Don't forget that the form, textarea and button tags all need closing tags. The input element should not have a closing tag (and in XHTML has to be a self-closing tag).