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
I have a Formik form where I show\hide various elements based on the user selection from a list. My form validation is based on Yup and I ONLY need to validate those element which are relevant based on user's selection from the list.
The issue I am facing is, when user selects one value from the list and fill-in other relevant elements, the isValid become TRUE so as my SAVE button though if user change their mind and select a different option from the list, where completely other set form elements get displayed, the SAVE button still remains enabled. This fails the form validation requirements.
So, is there any way in Formik to reset the isValid back to false when user changes the selection? also if user once again change the selection back to their original choice, I would expect the isValid become true as those values were already validated earlier.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a Formik form where I show\hide various elements based on the user selection from a list. My form validation is based on Yup and I ONLY need to validate those element which are relevant based on user's selection from the list.
The issue I am facing is, when user selects one value from the list and fill-in other relevant elements, the isValid become TRUE so as my SAVE button though if user change their mind and select a different option from the list, where completely other set form elements get displayed, the SAVE button still remains enabled. This fails the form validation requirements.
So, is there any way in Formik to reset the isValid back to false when user changes the selection? also if user once again change the selection back to their original choice, I would expect the isValid become true as those values were already validated earlier.
Beta Was this translation helpful? Give feedback.
All reactions