Skip to content

How to use transition with form being summited from js #1320

Closed Answered by sergiodxa
JakovGlavac asked this question in Q&A
Discussion options

You must be logged in to vote

The simpler way is to put an ID to the Form and then add a form attribute to the button element with the ID of the form. That will tell the browser the form of that button is your other form and when you click it (if type is submit) it will submit the form.

This way you don’t need to grab a ref or use the useSubmit hook, also it will work even without JS.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@JakovGlavac
Comment options

Comment options

You must be logged in to vote
2 replies
@sergiodxa
Comment options

@sairajchouhan
Comment options

Answer selected by JakovGlavac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants