Is it possible to have nested ValidatedForm #213
-
I know this is a long shot but I'll try anyway. Do you know if it is possible to have nested forms? I know that's not valid and I shouldn't do it but currently, this is the only way for me. Is there any way to stop the validation process from propagating top? I tried Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@airjp73 Do you have any solution to this? |
Beta Was this translation helpful? Give feedback.
-
I just found the solution myself. const formId = 'add-link-form'
<ValidatedForm
action="#"
validator={validator}
defaultValues={defaultValues}
onSubmit={onSubmit}
id={formId}
>
<Button form={formId}>
Update
</Button>
</ValidatedForm> |
Beta Was this translation helpful? Give feedback.
I just found the solution myself.
If you ever have a similar issue, add id to the validated form and use the same ID in the button's submit property: