Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hx-post with external submit button excludes the button value #1120

Closed
wooooodward opened this issue Nov 4, 2022 · 3 comments
Closed

hx-post with external submit button excludes the button value #1120

wooooodward opened this issue Nov 4, 2022 · 3 comments

Comments

@wooooodward
Copy link

Submitting a form with the submit button outside of the <form> tag does not include the button's name attribute as a parameter or its value ('lol': 'cats') in the request which is inconsistent with the default expected behaviour.

<form id="my-form" hx-post="/example">
  <input type="text" name="name" />
</form>

<input type="submit" form="my-form" name="lol" value="cats"/>
@mihalikv
Copy link
Contributor

mihalikv commented Mar 3, 2023

Same issue here with the newest version 1.8.5.

@drowe-official
Copy link

Also ran into this issue. It popped up when I was trying to use form buttons inside a Bootstrap modal footer. For anyone in the same boat- I ended up having to wrap the entire modal-dialog div in the form tag, which isn't ideal.

@alexpetros
Copy link
Collaborator

Resolved by #1559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants