Home > Software design >  submit child form that was inside another form and prevent submitting parent form, react-hook-form
submit child form that was inside another form and prevent submitting parent form, react-hook-form

Time:08-21

I am in the situation that I have to run function while submitting child form that was located inside another form and while I was submitting child form, parent form also running submit function, I give different id's and htmlFor of form attributes for the form but problem is not being solved. I am using react-hook-form

CodePudding user response:

Hope this link will be helpful to you. [Link][1]

[1]: https://github.com/react-hook-form/react-hook-form/issues/1005#:~:text=I fixed the problem I had to remove onSubmit of form tag and add it on onClick button :)

  • Related