Handle checkbox groups correctly
achilleas-k opened this issue · comments
Achilleas Koutsou commented
A fieldset of checkboxes is retrieved as a slice of strings, one for each checked option. The form processing function only takes the first value. This should be handled somehow.
The values are sent to the post action as a map of string -> string
, so this needs to be adapted somehow. Some ideas:
- Concatenate the values in a single string, separated by a special character (e.g.,
\n
).- A bit hacky but there shouldn't be values with
\n
in them so it would work.
- A bit hacky but there shouldn't be values with
- Change the value map to
string -> []string
to match the form values exactly.- Deeper change, but perhaps more correct.