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

Manpreet Singh
Manpreet Singh
13,014 Points

Why only we have to call function enableSubmitEvent

please solve this enableSubmitEvent I am little confuse about it

1 Answer

Leandro Botella Penalva
Leandro Botella Penalva
17,618 Points

When it is called the enableSubmitEvent will enable or disable the submit button depending of what returns the canSubmit function. The enableSubmitEvent are called in different places. At the end of the script which will disable the submit button as no password has been typed yet, and within the keyup events of the inputs so when the user types it is determined whether the submit button should be enabled or not.