I am trying to implement multiple select checkboxes in form.
For example: product can be produced in 4 colors. I need checkboxes for every color on product form.
I have read docs about Phoenix.HTML.Form, but I have found only select/4 and checkbox/3.
It is not very suitable if there are a lot of cases. And checkbox/3 is only for 1 case.
Does someone know if there something like select + checkbox in Phoenix?
Thanks!
If you’ve got a constrained set of choices and it’s more than two of them, I think you’d be better off to use a radio button control. Just a suggestion, of course.
I’ve done this, in a potentially somewhat different scenario, managing a many-to-many relationship where (in your case) the available colors would be stored in a separate table / model; see my post on the phoenix-talk list for details: