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

form validation #35

Open
bihongbin3027 opened this issue Jun 12, 2020 · 3 comments
Open

form validation #35

bihongbin3027 opened this issue Jun 12, 2020 · 3 comments

Comments

@bihongbin3027
Copy link

After I started your example, Skills removed multiple choices, Submit removed disabled={!formik.dirty}, changed the validation rules skills: array().required('At least one skill is required'), and then click submit to submit the form, This form verification error is not displayed.
image

@bihongbin3027
Copy link
Author

const validationSchema = object().shape({
username: string().required('Username is required'),
gender: string().required('Gender selection is required'),
country: string().nullable().required('Country is required'),
skills: object().nullable().required('At least one skill is required'),
birthdate: date().nullable().required('Birth date is required'),
interviewTime: mixed().required('Interview Time is required'),
})

@bihongbin3027
Copy link
Author

const initialValues = {
username: '',
gender: 'Female',
country: null,
skills: null,
birthdate: null,
interviewTime: null,
}

@gerhat
Copy link
Owner

gerhat commented Oct 22, 2020

@bihongbin3027 did you try an empty array on skills ?

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

2 participants