stimulusreflex / stimulus_reflex

Build reactive applications with the Rails tooling you already know and love.
https://docs.stimulusreflex.com
MIT License
2.28k stars 172 forks source link

Form data still not captured #366

Closed jonathan-s closed 3 years ago

jonathan-s commented 3 years ago

Bug Report

Describe the bug

It looks like form data is still not captured correctly. I was thinking that perhaps it's just my implementation in django that is wrong, but it does look like the data is not captured client side.

To Reproduce

I've made this codepen that simulates the behaviour that happens in utils.js. The function serializeForm takes a form element and we put that into FormData. FormData comes out empty despite containing elements that have values in them.

So it looks like FormData does not accurately capture the form data.

I've tried this in both chrome and firefox.

Expected behavior

The form data should be captured.

Versions

StimulusReflex

External tools

Well, mostly irrelevant in this case.

Browser

jonathan-s commented 3 years ago

It looks like I had forgotten to set the name of the form inputs. Which was the reason they were not captured.