Multiple checkbox form

I'm trying to implement https://fly.io/phoenix-files/making-a-checkboxgroup-input/ for a field that is a {:array, ;uuid}. When generating the form, using AshPhoenix, I can see that form.data and form.source have values inside the field that will be used in the multi checkbox field. However @value is always empty, so I can't tell if a given checkbox should be checked or not. I circumvented the problem by passing defining the checked flag as a third element in the options array. So, instead of passing [{"label", "value"}] as options , I'm passing [{"label", "value", true}] This works fine, but I was wondering if there is something I'm missing here. To generate the form, I'm using
resource
|> MyDomain.form_to_action()
|> AshPhoenix.Form.ensure_can_submit!()
|> to_form()
resource
|> MyDomain.form_to_action()
|> AshPhoenix.Form.ensure_can_submit!()
|> to_form()
Fly
Making a CheckboxGroup Input
Creating a custom core_component input for tagging items using a multi-select checkbox group.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?