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
Walden Wang
5,657 PointsCan anyone give me the "code challenge" for HTML forms?
Just stuck on step 2: Don't know what it means.
Please help^^
"Next, we need the flavor selected in the dropdown to be submitted to this process.php file. We need to be able to access it in the “flavor” element of the $_POST array like this: $_POST["flavor"]. What two changes do we need to make to the HTML? (Hint. We need to add two new attributes. The first needs to be added to one existing HTML element, the second needs to be added to a different existing HTML element.)"
2 Answers
Kevin Korte
28,149 PointsCan you post a link to the challenge? I'm too lazy to go find it myself.
Andrew McCormick
17,730 Pointswhere is this challenge at? I searched all of the places I saw Forms and couldn't find this one... either way check out http://www.w3schools.com/tags/tag_form.asp for some help what attributes you can use for forms.
The main attributes you need on your form to be able to do what they are asking is action and method, you will also need to have a name attribute for the elements that you want to access in process.php
Walden Wang
5,657 PointsIt's in the "Integrating with Paypal" - Code challenge: HTML forms.
Here's the link:http://teamtreehouse.com/library/programming/build-a-simple-php-application/integrating-with-paypal/html-forms
Walden Wang
5,657 PointsWalden Wang
5,657 PointsHere's the link: http://teamtreehouse.com/library/programming/build-a-simple-php-application/integrating-with-paypal/html-forms
:)
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsThe form needs a method, and the select element needs an name attribute. Those are the two attributes you need to add, at the two locations.
This bit in the question
$_POST["flavor"]tells you both of your answers. It tells you the method type, and the name you need to give the select icon.Walden Wang
5,657 PointsWalden Wang
5,657 PointsThanks. I know what I miss. I forgot the method="Post".
Thanks a lot !
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsGood deal. You're welcome!