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

Form Validation - Text Input Events.

I'm stuck on the code challenge.

The first bit asks me to hide the class of "hint" which I did by entering:

$(".hint").hide();

The next part asks me to : "Select all inputs and on the 'keydown' event select 'this' and then show the next element."

I have entered in:

$("input,text").focus(function(){ $(this).next().fadeIn("slow"); });

I get the following error message:

"You did not call next() on $(this) and showed the returned element."

I'm calling an input of "text," and am not sure what I've missed.

Help??

5 Answers

Figured it out!!!!

I entered in:

$("input,text").keydown(function(){

$(this).next().show();

});

I've also tried entering the following:

$("input,text").focus(function(){ $(this).next().keydown(function(){$("input")

}); });

Just tried entering this:

$(".hint").hide();

$("input,text").keydown(function(){ $(this). $("input")

});

The notification came up as "null."

It seems like often times, less is more with code! I really made things overly complicated!

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Glad you got there in the end.

Sometimes when you see null there may be a syntax error and our Code Challenge Engine can't parse something correctly.