germsvel / phoenix_test

MIT License
144 stars 20 forks source link

Static form submits don't include all pre-rendered data #57

Closed ftes closed 4 months ago

ftes commented 5 months ago

Expected

Given a form

<form>
  <input name="input" value="value" />

  <select name="select">
    <option value="not_selected">Not selected</option>
    <option value="selected" selected>Selected</option>
  </select>

  <input name="checkbox" type="checkbox" value="not_checked" />
  <input name="checkbox" type="checkbox" value="checked" checked />

  <input name="radio" type="radio" value="not_checked" />
  <input name="radio" type="radio" value="checked" checked />
</form>

I expect submit_form/3 to submit the following data

input=value
select=selected
checkbox=checked
radio=checked

for all of these cases:

Actual

For static forms (both in static and live view), only this data is submitted:

radio=checked
germsvel commented 5 months ago

Great catch @ftes! Thanks for opening this issue. I think this should be somewhat straightforward to add.

ftes commented 5 months ago

Neat. I opened #58 with failing tests. Didn't look into fixing it yet. If you're on it: great! If you're tight on time, let me know and I'll be happy to dig further.