Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Jonathan Leon
18,813 PointsMy form works but wont take me to 404 page, it just takes me to the form page again, is it okay?
?
4 Answers

marvelousperson206
9,199 PointsPretty sure that's cool.. happens with me too

Marlinda Davis
7,423 PointsThe same thing happened with me too.

james rochabrun
Courses Plus Student 22,726 Pointssame over here

Ziyu Zhou
739 PointsSAME
Jonathan Leon
18,813 PointsJonathan Leon
18,813 Points// Problem: Hints are shown even when forms are valid // Solution: hide and show the hints when valid var $password = $("#password"); var $confirmpassword = $("#confirm_password");
$("form span").hide();
// find out if password is valid
function isPasswordValid() {
return $password.val().length > 8 ;
}
function passwordEvent() {
if (isPasswordValid()) {
//Hide hint if valid
$password.next().hide(); } else {
//else show hint
$password.next().show(); } };
function arePasswordsMatching () {
return $password.val() === $confirmpassword.val() ; }
function confirmpasswordEvent() { // find out if password and confirmation match if (arePasswordsMatching()) { // hide hint if match $confirmpassword.next().hide(); } // else show hint else {
$confirmpassword.next().show();
}}
// when event happens on password input
$password.focus(passwordEvent).keyup(passwordEvent).focus(confirmpasswordEvent).keyup(confirmpasswordEvent).keyup(enableSubmitEvent);
// when event happens on confirmation
$confirmpassword.focus(confirmpasswordEvent).keyup(confirmpasswordEvent).keyup(enableSubmitEvent);
// if user can submit functions
function canSubmit() {
return isPasswordValid() && arePasswordsMatching();
}
// submit disable\enable
function enableSubmitEvent() {
$("#submit").prop("disabled" , !canSubmit());
}
enableSubmitEvent();