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

Can Anyone Figure This Challenge Out

Please help with this challenge:

In the canSubmit() function add to the return call if the isUsernamePresent() too.

function canSubmit() {
  return isPasswordValid() && arePasswordsMatching();
}

function passwordEvent(){
    //Find out if password is valid  
    if(isPasswordValid()) {
      //Hide hint if valid
      $password.next().hide();
    } else {
      //else show hint
      $password.next().show();
    }
}

link:http://teamtreehouse.com/library/improving-the-form-validation

4 Answers

You need to add isUsernamePresent() to the list that it's checking on return.

Like this:

function canSubmit() { return isPasswordValid() && arePasswordsMatching() && isUsernamePresent(); }

jQuery needs to be redone.

Right, i forgot about the username

thanks!!

yup he gave you the answer man