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 Inputs

Paul Barron
Paul Barron
6,595 Points

<form action="">

Am I right to assume that action basically points the submission to a set of instructions (or site) when dealing with php or something as such?

3 Answers

Kevin Korte
Kevin Korte
28,111 Points

Yes, action is describing where the form data is going. A form can submit the page it is on even. If the form action is empty like what you have in your title, or just isn't there, the form should default back to page it is on. You could have PHP code on that same page that handles a form submit. These backend languages will have ways of checking for form submits and ways to extract and handle the data.

It points to a server-side script that processes the contents of the form: validates the information, inserts it into a database, redirects to another page, etc.

It (the file referenced in the action="") can be written in a variety of languages/scripts PHP, ASP, Java, etc.

Sergi Beltran
Sergi Beltran
18,493 Points

Hi Paul, the action attribute indicate where you form data will go. What file will receive the data and and work on it.