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 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,148 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.