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 trialVenkataraman Chandrasekhar
2,061 PointsPHP and Javascript
I want to work through the two PHP modules (simple project and the enhanced project). I would love to know which lesson has examples of using JavaScript. Specifically, I want to read the option picked by a user in a Select element and turn some checkboxes on accordingly.
Thanks.
8 Answers
George Offley
Courses Plus Student 7,386 PointsWhich lesson I can't tell you, are you looking to get certain information from the lessons?
Venkataraman Chandrasekhar
2,061 PointsI am making some changes to an existing PHP project while working through the Treehouse PHP track.
Here is a summary of the changes:
A form has a Select element and a series of checkboxes. Based on what the user selects in the Select element, several checkboxes should be checked.
I would like to do this preferably using Javascript.
PHP generates the form and sends to the browser.
User fills the form. His choice of Select fills in checkboxes. (JavaScript code runs at this time.) He then submits the form.
If there is an example in the PHP track lessons, I would like to view that. I am viewing the lesson in order but I have an immediate need.
Thanks, again.
George Offley
Courses Plus Student 7,386 PointsWell you could use some java script to detect when you chose something from the drop down then you can use JS to alter the DOM elements to be checked. Does that make sense?
Venkataraman Chandrasekhar
2,061 PointsYes.
If the course has examples, I would like to see them. Thanks.
George Offley
Courses Plus Student 7,386 PointsI found a jsfiddle that does this with only HTML and jQuery:
Venkataraman Chandrasekhar
2,061 PointsThanks. I will look through this. I need to figure out what jsfiddle is first :-)
George Offley
Courses Plus Student 7,386 PointsIt's a website that hosts live code, hit the link and look at the page. It's split up into HTML, CSS, and JS. I use it to test JS scripts.
Venkataraman Chandrasekhar
2,061 PointsThanks.