Forum Academy Marketplace Showcase Pricing Features

Want to ask users to select at least one checkbox out of 9

Hello bubblers,

I am creating a website where users will be creating listings. One of the fields of the listing is a “special features” consisting of 9 checkboxes. I would like users to select at least 1. I can’t quite understand how to make users select at least one, so that they can’t leave all 9 options unchecked.

I have tried using multiple checkbox, but looks like I have to use the standard checkbox, becuause I have 9 options and sometimes not all options are visible in the dropdown menu. You have to scroll and I am worried that users won’t see all options. So I need 9 visible checkboxes, but I want users to select at least one of the options and not be able to leave all checkboxes unchecked.

I have another field, with 6 checkboxes, but there I am ok if users don’t select any.

I hope it makes sense, please, let me know if anything is unclear.

Thanks,
T

try to use custom state for this case. Sure, it works.

Yes, you can create a custom state of type number. Set it at zero to start. Whenever one of the checkboxes is clicked, you increment the custom state. When a checkbox is unclicked, you decrement it. When the user goes to the next step in the process, you can do a check if the custom state is > 0 or not. If not, send an alert message that they must check at least one box.

1 Like

thanks a lot @joeyg will try this out!