Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

jQuery Utility Methods

Not seeing where I'm going wrong on this...

var values = $(".required").map(function(){ return $(this).val() == "";});

It's task 1/2 on the jQuery utility methods in Form Validation and Manipulation.

Instructions are: Call 'map' on the inputs with the class 'required' and return each of their values and store it in a variable named 'values'.

Thanks

3 Answers

Hi Taylor,

I couldn't agree more re their messages.

I am also struggling with this one, have tried all possible permutations I think.

Could you please send me your code that finally resolved this.

Would be much appreciated.

Thanks

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hi there,

The values are just $(this).val(). The == "" would return if they are blank or not. If you remove the =="" you should be fine.

Regards Andrew

Deleted User

Your error messages leave a lot to be desired. You do not mention if you want a function call, or just the line requested in the description etc. what is it you exactly want.?? When I type out : var values = $(".required").map(function(){$(this).val();}); The error msg states I have not set "values".. You have to give us a little more to work with as your video really does not show the answer.

revised: after much playing around I finally figured it out...you still need better messages.