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
Currently you can get all the value of a form using .getValues() but that includes invalid values.
You can also use .handleSubmit() to get the values when all validation has ran.
Is there any way to get all valid values and filter out the invalid ones? The only way I can think to achieve this is to use a combination of .getValues() and formState.errors but that seems like it could be tricky and error prone when using dot notation names (which I am).
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
-
Currently you can get all the value of a form using
.getValues()
but that includes invalid values.You can also use
.handleSubmit()
to get the values when all validation has ran.Is there any way to get all valid values and filter out the invalid ones? The only way I can think to achieve this is to use a combination of
.getValues()
andformState.errors
but that seems like it could be tricky and error prone when using dot notation names (which I am).Beta Was this translation helpful? Give feedback.
All reactions