You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const validationSchema = Yup.object({
firstName: Yup.string().required('First name is required'),
lastName: Yup.string().required('Last name is required'),
email: Yup.string().required('Email is required'),
role: Yup.string().required('Role is required'),
employerName: Yup.string().required('Employer Name is required'),
countryId: Yup.string().required('Country is required'),
stateId: Yup.string().required('State is required'),
password: Yup.string().required('State is required'),
confirmPassword: Yup.string().required('State is required'),
});
const onSubmit = async (values: any) => {};
constvalidationSchema=Yup.object({firstName: Yup.string().required('First name is required'),lastName: Yup.string().required('Last name is required'),email: Yup.string().required('Email is required'),role: Yup.string().required('Role is required'),employerName: Yup.string().required('Employer Name is required'),countryId: Yup.string().required('Country is required'),stateId: Yup.string().required('State is required'),password: Yup.string(),confirmPassword: Yup.string(),});
const initialValues = {
salutation: '',
firstName: "",
lastName: "",
email: '',
role: "",
employerName: "",
countryId: "",
stateId: '',
password: '',
confirmPassword: '',
};
const formik = useFormik({
initialValues,
validationSchema,
onSubmit,
});
now how can i validate fields except password and confirmPassword on type button click?
The text was updated successfully, but these errors were encountered: