I have a few checkboxes, that based on 1 or 0 (INT) are checked or unchecked. (for setting active and other stuff).
But when specifying input TV type as checkbox-TV, it lists as a textfield.
Anyone an idea what i'm overlooking here?
Regards
Robin
input TV type: checkbox
doesn't do it?
btw: you can also create switch-buttons in the grid to switch between different options, directly from grid.
you will need inputOptionValues like: yes==1
Ah, that works like a charm indeed. I'm assuming that the same goes for radio's ?
What about multiple checkboxes per field?
Let's say i have 5 options wich could all be selected but also 2 of 5 or none etc.
I know that in Input Options Values i can separate them easilly by adding || between, but how to let them checked/unchecked properly.
The values are stored like 1;2;4;, number values separated by a semicolon. Normally i would just explode this in php, but that don't fly in migxdb, and should probably do such a thing with JSON wich i know exactly 0,0 about:-)
they should be stored like any other multi-select-TV in modx separated by || - (doublepipes) in the db.
aren't they?
definitiv:
multi-checkboxes should be stored as doublepipe-delimited values.
And should work without any additional coding.
on update the array is converted to a doublepipe-delimited list.
on reading for the update-form the delimited-list is converted back to an array and the checkboxes should be checked.
If you have ; delimited lists, I would replace all of them with ||