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!

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 Using next()

Please I need fix it this parts

How I do it this?

//Problem: Hints are shown even when form is valid
//Solution: Hide and show them at appropriate times

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

function passwordEvent(){
    //Find out if password is valid  
    if($("form span").val().length > 8) {
      //Hide hint if valid
    } else {
      //else show hint

//When event happens on password input

//When event happens on confirmation input
  //Find out if password and confirmation match
    //Hide hint if match
    //else show hint 
<!DOCTYPE html>
    <title>Sign Up Form</title>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">

    <form action="#" method="post">
            <label for="username">Username</label>
            <input id="username" name="username" type="text">
            <label for="password">Password</label>
            <input id="password" name="password" type="password">
            <span>Enter a password longer than 8 characters</span>
            <label for="confirm_password">Confirm Password</label>
            <input id="confirm_password" name="confirm_password" type="password">
            <span>Please confirm your password</span>
            <input type="submit" value="SUBMIT">
    <script src="//code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/app.js" type="text/javascript" charset="utf-8"></script>

1 Answer

Steven Parker
Steven Parker
228,077 Points

You did fix it, but then you made some unnecessary changes.

The real fix needs to be done on just one line, and you did it. But on that line and others you made some extra changes, in particular replacing the references to "this". None of that should be changed.