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 Perfect

Submit still working even when passwords don't match

I can still click the "Submit" button and it will load to the same page. Even when the passwords aren't matching and the username is long enough. It's supposed to disable the button when the username isn't long enough, the password not long enough, or the passwords not matching. Here is a link to a snapshot of my code... https://w.trhou.se/jtvr01dhy4

2 Answers

simhub
simhub
26,544 Points

hi David, i am not sure, but i thing its just a typo:

//  i thing you forgot to run the function "!canSubmit()" - because you just wrote "!canSubmit" without Brackets 
function enableSubmitEvent () {
    $("#submit").prop("disabled", !canSubmit())
}

Yup, that fixed it! Thanks!