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

Encode Form Submitter [name] into submission #653

Merged
merged 1 commit into from Jul 29, 2022

Conversation

seanpdoyle
Copy link
Contributor

Closes hotwired/turbo#272

Do not exclude a <form> submitter's [name] attribute from the
encoded FormData instance, even if a [value] is not specified.
Instead, encode the value as an empty string if a [value] attribute is
unspecified.

The existing tests included a button to exercise this exclusion
behavior. Their assertions were incorrect, so this commit changes them
to reflect the proper behavior.

Closes [hotwired#272][]

Do not exclude a `<form>` submitter's `[name]` attribute from the
encoded `FormData` instance, even if a `[value]` is not specified.
Instead, encode the value as an empty string if a `[value]` attribute is
unspecified.

The existing tests included a [button][] to exercise this exclusion
behavior. Their assertions were incorrect, so this commit changes them
to reflect the proper behavior.

[button]: https://github.com/hotwired/turbo/blob/1563ebbfa3f4c8530b334e194da9db630163041b/src/tests/fixtures/form.html#L103
[hotwired#272]: hotwired#272 (comment)
@dhh dhh merged commit e434e5e into hotwired:main Jul 29, 2022
@seanpdoyle seanpdoyle deleted the fix-issue-272 branch July 29, 2022 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

form with multiple submit buttons, clicked button is lost
2 participants