Project Authorization Form

link: https://www.codecademy.com/en/courses/react-101/projects/authorization-form?action=lesson_resume&link_content_target=interstitial_undefined&link_content_target=interstitial_undefined

i don’t understand step 7, it says:
"On lines 14 through 21, you can see a method named .authorize().

This method will check whether a submitted password is equal to ‘swordfish’. If it is, then this.state.authorized will become true.

You need authorize to get called whenever a user hits “Submit!”

Give the <form></form> an onSubmit attribute. Set the attribute’s value equal to the authorize function."

It gives me this code (

 <form action="#" onSubmit={this.authorize}>

) as a hint but I don’t know where to put it.

Can anyone help?

The FORM element is in the login JSX object.

    const login = (
      <form action="#" onSubmit={this.authorize}>
        <input type="password" placeholder="Password" />
        <input type="submit" />
      </form>
    );

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.