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
Luke Lee
7,577 PointsIn responsive design, Can I hide mandatory field in contact form?
If I have a comprehensive form on desktop site. And I want to simplify it in mobile layout. I know I can use display: none. but some of fileds are mandatory, can media-query be used in php or js file??
1 Answer
Ricardo Hill-Henry
38,443 PointsYou could give each of the fields you want to toggle off a class of say .hide, and simply create a style that hides elements with the class .hide inside of your query with nothing but css.
Personally, I would just redesign the field for mobile devices so that it fits the screen nicely, and isn't a hassle for the user; but if it's not necessary than I can see why.