This is an example of a form that is not completely generate by the Form library but only use single form component and spread them inside existing element, like the table in the example below.
type alias Model =
{ formState : R10.Form.State }
initModel =
{ formState = R10.Form.initState }
type Msg = MsgForm R10.Form.Msg
update msg model =
case msg of
MsgForm formMsg ->
{ model | formState = R10.Form.update formMsg model.formState }
and this is all you need as boilerplate.
To generate checkboxes:
R10.Form.Element.checkbox model.formState MsgForm 0
R10.Form.Element.checkbox model.formState MsgForm 1
R10.Form.Element.checkbox model.formState MsgForm 2
R10.Form.Element.checkbox model.formState MsgForm 3
etc...
To get the list of touched indexes:
Dict.keys model.formState.fieldState
To get the list of checked indexes:
Dict.keys <| Dict.filter (\_ v -> stringToBool v.value) model.formState.fieldState