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
Douglas Watts
5,464 PointsCan 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
Nichole Frazier
9,653 PointsYou need to add isUsernamePresent() to the list that it's checking on return.
Like this:
function canSubmit() { return isPasswordValid() && arePasswordsMatching() && isUsernamePresent(); }
Rich Braymiller
7,119 PointsjQuery needs to be redone.
Douglas Watts
5,464 PointsRight, i forgot about the username
thanks!!
Adama Sy
7,076 Pointsyup he gave you the answer man