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

Validate component #24

Open
XavierGeerinck opened this issue Sep 17, 2015 · 0 comments
Open

Validate component #24

XavierGeerinck opened this issue Sep 17, 2015 · 0 comments

Comments

@XavierGeerinck
Copy link
Owner

Should have:

  • type
  • placeholder
  • label
  • name
  • checkEmail (if true, check if email)
  • checkMinLength (specify a length)
  • checkMaxLength (specify a length)
  • checkRequired (if true, make sure it is not empty)
  • ....

This way we can move the validate towards the component itself. Also add a state so that we can specify if it is valid or not.

TODO: How can we check if the form is valid as a whole? (so on submission). Several solutions that I can think of:

  • Expose a function is validate in the validateinput to check every component
  • Create a custom form component that can do this by a function isValid?
  • Go through the states of the methods one by one manually?

I think option 2 is the best and easiest since it removes all clutter and makes for easy submission

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

No branches or pull requests

1 participant