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 trialandrewg
7,157 PointsCan anyone tell me the html for this input form?
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Andrewg,
This would be the basic idea:
<form action="#">
<input type="text" name="name" id="name" placeholder="name" />
<input type="text" name="email" id="email" placeholder="email" />
<input type="submit" value="Submit" />
</form>
andrewg
7,157 PointsI wanted to know how to put 'name' and 'email' inside of the forms as shown in the picture. I couldn't figure out how and couldn't find anywhere online as to how to do that. The lesson in which they came from didn't explain it either.
banu babanu
8,152 Points<form>
First name: <input type="text" name="firstname" value="name"><br>
Last name: <input type="text" name="lastname" value="lastname">
</form>
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsYou should also consider having labels with each input rather than relying on the placeholder text as a label.
Treehouse recently launched an html forms course that you may want to check out: http://teamtreehouse.com/library/html-forms
andrewg
7,157 Pointsandrewg
7,157 PointsThank you so much!! I'll check out that course!
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsYou're welcome.
I haven't been through it myself so I don't know how much it goes into this.
If you're against having separate labels next to the inputs then you could also look at the float label pattern
This gives you a way to have both the label and placeholder text and still conserve screen space.