Submit a form within another form's onSubmit.
I have 2 forms via useForm
When form_A is submitted, I would also like form_B to be submitted. How would one programatically trigger the submission of form_B when the submission of form_B occurs?
3 Replies
Hi @UsererOfName. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the extracts, you can use the
submit
function from the useStepsForm
hook to programmatically submit a form. However, the extracts do not provide a direct example of how to trigger the submission of one form based on the submission of another form.
Here's a general idea of how you might approach this:
In this example, when form_A is submitted, form_B is also submitted. Please note that this is a general idea and might need adjustments based on your specific use case.
For more detailed information, you may want to refer to the useStepsForm documentation (https://refine.dev/docs/api-reference/antd/hooks/form/useStepsForm).
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@1032307923235373217> kapa.ai is still learning and improving, please let us how it did by reacting below
afraid-scarlet•15mo ago
@kapa.ai Can you provide an example that uses the 'useForm' hook instead of the 'useStepsForm' hook?
@kapa.ai Can you provide an example that uses the 'useForm' hook instead of the 'useStepsForm' hook?