G-Node / tonic

Framework for building services that interact with GIN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle checkbox groups correctly

achilleas-k opened this issue · comments

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.
  • Change the value map to string -> []string to match the form values exactly.
    • Deeper change, but perhaps more correct.