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

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

Challenge task 4 of 5 After the textarea, create a button element. Between the button

This was my answer, why is not working? any help?

<!DOCTYPE html>

<html>

#<head> #<meta charset="utf-8"> #<title>HTML Forms</title> #</head> #<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>

</html>

Thanks Francesco

Christian Frick
Christian Frick
14,586 Points

Post it please with the Markdown Cheatsheet

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

Bummer! You need to add a <button> element inside the <form> element.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <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> </html>

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

Bummer! You need to add a <button> element inside the <form> element.

#####<html>

<head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <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> </html>

14 Answers

Peter Ramsing
Peter Ramsing
16,814 Points

I initially wanted to create a button that would submit the form. What they are looking for is just the button, though. Here's what I got to make it pass:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>HTML Forms</title>
  </head>
  <body>
   <form action="index.html" method="post">
     <input id="name" name="user_name" type="text">
     <textarea id="comment" name="user_comment">
     </textarea>
     <!--Submit Button-->
     <button>Submit Comment</button>
   </form>
  </body>
</html>

The button code was:

     <button>Submit Comment</button>
Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

still don't understand why copying and pasting your code worked!! ;-))

Thanks Peter, thanks Christian!

Francesco

That's exactly what I've been doing and it still tells me I haven't added a button yet. Just the the plane button tags with the submit comment in between and it still doesn't work?!

Zach Lorber-Termaat
Zach Lorber-Termaat
7,680 Points

A closing tag must be added to the textarea from step 3. You can pass step 3 without the closing tag but you cannot add the button successfully without the closing tag.

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

try

<button>Submit Comment</button>

or

<button type="button">Submit Comment</button>
Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

no way! I think there is a bug or something!!

I will submit a technical request!

Thanks Christian

You need a closing tag for textarea

Yonatan Arbel
Yonatan Arbel
7,055 Points

closing the text area will resolve the issue <textarea></textarea>

I experienced a similar problem, but I don't know if it was due to the same reason. My issue was that I was adding a closing tag to input. This isn't valid. However, the code challenge will allow you to pass all the way to Question 4, but once there you won't pass until you remove the invalid /input tag. Also, you can check to determine if you forgot to add a closing tag to textarea.

Boy Buijsman
Boy Buijsman
13,773 Points

Best comment, you forgot the </textarea>

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

oh yes! sorry coming soon I don't understand why it disappeared in the comment!

Christian Frick
Christian Frick
14,586 Points

Try the Hashtag Icon before your sentence the HTML-Markdown-Tag

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

it doesn't work, or at least I'm not able to use it!!

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

'''<html> <head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <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> </html> '''

Christian Frick
Christian Frick
14,586 Points

This Adds the Button:

<input type="submit">

Can you write the whole Challenge Description?

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

After the textarea, create a button element. Between the button tags, write the text "Submit Comment". Don't add any attributes yet.

doesn't work, message: Bummer! You need to add a <button> element inside the <form> element.

tried <input type="submit"> doesn't work

Francesco Vittorio Beninato
Francesco Vittorio Beninato
3,624 Points

'''html

<html> <head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <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> </html>

'''

Austen Allred
Austen Allred
6,521 Points

I had the same problem; my issue was that I hadn't closed the <textarea> with a </textarea>. That let the previous task pass, but ran into issues when I was creating a button (as I was technically trying to put a button inside of the textarea).

HTML FORMS CHALLENGE TASK 3 OF 4...

After the name field, add another input for email addresses. Set the type attribute to "email", the id attribute to "email", and the name to "user_email".

i am nerd can't not solve this..... need help .... please