hack4impact-calpoly/go-see-foundation

Conditional Rendering - Error Messages

Opened this issue · 0 comments

Description

In create account:

  • passwords match
  • email + phone number have proper length
  • user type field is selected

One recommended way to tackle this is to set up a use state for every input option. When ever a field is interacted with, change the state for an input if certain conditions are met; i.e) passwords match, the phone number field is fully filled out. Add an extra function that checks all use states before allowing a submit to occur. Nest this function in the existing handleSubmit function. If a field is not present or incorrect, print it under the form in red, bold text and do not allow the handle submit code to run.