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

PHP

I Want to submit two forms, one after the other.

Hi, I want to submit the 2nd form in php, if the 1st form has been submitted. if the user submitted the second form, the message displays that you need to submit the form 1st, then only you can submit the form 1.

2 Answers

Zoltán Holik
Zoltán Holik
3,401 Points

You can do this in elegant way with javascript or jquery and ajax request.

Example: https://jsfiddle.net/50umzrth/

Hi, i tried this, but it's not working. Please help. Is there no way to do it with PHP.

Matthew Panton
Matthew Panton
15,228 Points

in the 'url' parameter of the ajax function, give it the path to your php file which processes the form