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 Choosing Options Checkboxes

Why is name="[value]" not needed?

In HTML lesson on radio buttons ---->

< input type="radio" id="..." VALUE="..." name="..." >

BUT

In HTML checkbox lesson --->

< input type="checkbox" id="..." >

1 Answer

This code challenge is a bit confusing! The name attribute IS required if you want your server-side code to be able to see the checkbox value. If you submit a form with this code, the shipping and newsletter values will be discarded.

If you watch the associated video, Nick does include a name attribute when he creates checkboxes. I don't know why the challenge doesn't require it!