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

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.