Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional Rendering - Error Messages #145

Open
3 tasks
ragdassi opened this issue May 21, 2024 · 0 comments
Open
3 tasks

Conditional Rendering - Error Messages #145

ragdassi opened this issue May 21, 2024 · 0 comments
Assignees
Labels

Comments

@ragdassi
Copy link
Collaborator

ragdassi commented May 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants