-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I have a use case where form has multiple buttons each of them pointing at the same controller action but each with a separate name and value:
<button class="btn btn-sm btn-danger" id="mark-released" name="action[is_released]" type="submit" value="true">Release</button>
<button class="btn btn-sm btn-danger" id="mark-released" name="action[is_deployed]" type="submit" value="true">Deployed</button>In my tests, with the current implementation of follow_form I can never get the value of the button to be set as:
follow_form(conn, %{
action: %{is_deployed: "true"},
metadata: %{"#{version0.id}": "true", "#{version1.id}": "true"},
},We currently use v0.7.0 but if this is of interest I'd be willing to submit a patch to 0.7.0 and higher versions.
From a quick look at it in 0.7.0, it requires adding some lines in request.ex
defp get_form_data(form) do
%{}
|> build_form_by_type(form, "input")
|> build_form_by_type(form, "textarea")
|> build_form_by_type(form, "select")
|> build_form_by_type(form, "button")
end
...
defp get_input_value(input, "button") do
Floki.attribute(input, "value")
endI can see this would be very different for current HEAD, so I wanted to check before jumping into the code currently in master.
Metadata
Metadata
Assignees
Labels
No labels