I have a fairly large group of checkboxes that I want to display in 2 columns, sorted alphabetically from top to bottom.
The checkboxes are in a mandatory block.
I didn't want to change the layout for each checkbox and drag them across manually. So I wrapped the first and second half of checkboxes in blocks, gave those a width of 6 and then put them side by side.
But now I cannot get past the mandatory error? Keeps telling me the [block name] is required even when I check all of them?
I think there is a way you can achieve what you want.
!(data.checkbox1 || data.checkbox2 || data.checkbox3 || data.checkbox4 || data.checkbox5 || data.checkbox6)
This code is just a simple demo checking that at least one of the group has been clicked at least once. You will want to use different logic depending on whether you show your checkboxes dynamically or not.
Thanks Bill. I'll get someone to try that out.
It is still a shame it doesn't work without having to edit the mandatory rule because it does in Composer.
We tested this and that workaround does work.
Your solution worked. It is time consuming with a significant number of check boxes in a container though and would be great to see a feature to set the number of columns and rows to the items appearance.
I was able to reproduce this by having an outer mandatory block wrapping two inner non-mandatory blocks, with each inner block wrapping the checkbox columns.
If I changed the two inner non-mandatory blocks to mandatory blocks, it worked, but enforced the mandatory rule for each column independently. i.e. each mandatory block column needed to have one checkbox checked.
To make it function correctly, I set all checkboxes to width 6, positioned them where I wanted in columns, and wrapped them in a single mandatory block.
I'll check with the Maestro team to see if this behavior is as expected.
I know I can manually drag them across, but it would be really nice if there was an easier way to do this because occasionally forms may have a large number of checkboxes in a mandatory group. So setting all of them to width 6 is time consuming and you then also have to figure out their new order if you want them alphabetically sorted from top to bottom in each column (as opposed to zig-zag sorting).
Can this possibly be logged as a feature request?
In the meantime we will have to write our own business rules for some of these scenarios as sometimes we have to add other fields to mandatory checkbox blocks (when selecting a checkbox triggers showing another checkbox group for example) and we cannot avoid using blocks inside them.