Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Forms Form Basics The Button Element

3 Answers

When the information in the form gets sent to the server, that info gets stored in name-value pairs.

The server will get that info and store it like this:

user_first-name = "John" user_last-name="Doe"

Here's some reference http://www.w3schools.com/tags/ref_httpmethods.asp

Jeff Lemay
Jeff Lemay
14,266 Points

You can set the name attribute to whatever value you want. It could be name="this_is_a_super_long_and_unnecessary_name_value" or it could be name="name" or name="email_address".

Typically people try to name things to relate to what they're needing for the form. So in this case, "user_name" would be a good choice for a field in a form that is needing a "user_name" for a login or something along those lines.