TanStackT
TanStack2y ago
2 replies
technical-ivory

How can I trigger validation of a field array when I change one of the subfields of an array item?

My form has an array field which has a checkbox subfield. Only one item in this array must be selected. If I try to submit the form without any checkbox selected, the validation works as intended. However, if I select one checkbox after that first invalid submission, the submit button remains disabled (even though the form is valid). I can only enable the button after adding and deleting a new item.

I haven't figured out how to trigger validation of the array when any checkbox changes. Is there a way to do this?

For reference, I attached the code snippet with the array field.

Thank you!
Was this page helpful?