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.

Databases

Garrett Reid
seal-mask
.a{fill-rule:evenodd;}techdegree
Garrett Reid
Front End Web Development Techdegree Student 16,040 Points

Creating a Working Registration Form

Hello everyone. I'm needing some help understanding something. I know how to create and style a form with HTML and CSS. I just need to know how to make it function. Can i do this completely with JavaScript and Node.js? What are the components and knowledge you need?

I've read a bit and I think I need a database for the Form to "post" to? Or does it post to the server? I've heard I need a server-side language, but Node.js makes JavaScript run Server-Side doesn't it?

I wasn't sure which topic to post this under. If you feel it needs to be somewhere else, Please let me know :) Thank you all very much for helping me sort this out.

1 Answer

Kevin Korte
Kevin Korte
28,109 Points

There are a couple of options, and Node is one option that can handle form data. Any server side language will have ways to receive data, and than do something with it. The form itself does actually just post to the server, from there, it's our job to tell the server what to do with the form.

The most common is the form data gets posted into a database, that is pretty standard. However, the submitted form could just be generated into an email and sent out by the server. Say you has a simple contact form on your personal website, you could just have the server email you the form contents to your gmail account instead of posting to a database.

Garrett Reid
seal-mask
.a{fill-rule:evenodd;}techdegree
Garrett Reid
Front End Web Development Techdegree Student 16,040 Points

Okay. I understand. I'm learning JavaScript now. If i use Node, I wouldn't have to learn another language? I could create the DB with JS and just tell it what to do with the form? I really don't want to have to learn another language, but I will if i have to.

Kevin Korte
Kevin Korte
28,109 Points

Right, Node is just js that does server side stuff, so it's the same familiar syntax.