Submit the form with a button outside the form #4293
-
Hello, I use the component Thank you. Regards. |
Beta Was this translation helpful? Give feedback.
Answered by
sadeghbarati
Sep 25, 2023
Replies: 2 comments 4 replies
-
Have you figured out how to do this? const form = ref()
// works but refreshes the page
form.value.submit()
// doesn't work
form.value.dispatchEvent(new Event('submit') |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can use like <form id="uniqueFormId">
...
</form>
<button form="uniqueFormId">submit</button> |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
logaretm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
form
attribute on the button (which is outside of the form)like