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

Enable custom validations for onLiveErrorFeedback #29

Open
CarlosRafael22 opened this issue Mar 24, 2021 · 0 comments
Open

Enable custom validations for onLiveErrorFeedback #29

CarlosRafael22 opened this issue Mar 24, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@CarlosRafael22
Copy link
Owner

We cannot have a different validation apart from the standard ones provided. If we want to validate more than with the min, max, etc.. functions we are not able. There should be a way to enable custom validation with the values of different fields.

PROPOSED IMPROVEMENT:

const onLiveErrorFeedback = (validate: Function) => {
    return [
      validate('firstName').uppercase().min(6, 'Must have more than 6 caracters').max(8, 'Must have 8 at most'),
      validate('lastName').lowercase().min(6, 'Must have more than 6 caracters').max(10, 'Must have 10 at most'),
      validate('lastName').custom(values => (values.lastName.indexOf(' ') > -1, 'Should have space'))
    ]
  }
@CarlosRafael22 CarlosRafael22 added the enhancement New feature or request label Mar 24, 2021
@CarlosRafael22 CarlosRafael22 added this to the Publish first version milestone Mar 24, 2021
@CarlosRafael22 CarlosRafael22 self-assigned this Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant