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!
2 Replies
rare-sapphire•15mo ago
@pw can you make this a StackBlitz link instead if possible? I'm on mobile today and it's much easier for me to review
quickest-silver•8mo ago
Did you ever figure this out? I have similar logic where I am validating the subfield which is working fine, but I want to disable an "add new" button in the array field if any of the subfields have errors. The subfield errors are working fine but they arent propogating up to the array field