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 Basics (2014) Creating a Password Confirmation Form Perform: Part 1

Ogechi Ike
Ogechi Ike
6,539 Points

The hints aren't appearing on my form

Here is my code. I have tried to get the code to work and I have looked over it at least a dozen times, but it won't work.

//Problem: Hints are shown even when form is valid
//Solution: Hide the hints when form is vaid

//1.Hide hints
  $("form span").hide();

function passwordEvent(){
  if($(this).val().length > 8){
    $(this).next.hide();
  }else{
    $(this).next.show();
  }
};
//2.Find out if password is valid
$("#password").focus(passwordEvent).keyup(passwordEvent);
  //2.1Hide hint if valid 


//When event happens on confirmation input
    //Find out if password and confirmation matches
      //Hide hint if match 
      //Else show hint does not match

1 Answer

Hi Ogechi,

You're missing parentheses after next in both places.