Skip to main content
September 19, 2023
Question

Checkbox with only one choice value and choice label where you can select or deselect giving true or false

  • September 19, 2023
  • 3 replies
  • 0 views

I'm trying to do a required field but I only want the option to select or deselect the required field, I know I've seen that done somewhere, do any of you know how to do it?

Thanks

3 replies

mikes0011
Brainy
September 19, 2023

Can you clarify- are you saying you're requiring the user to check the checkbox?  As in, if they uncheck it, it'll still fail "required" validation?

Apart from the "required" portion here, I've always implemented a "boolean checkbox" component feature in my environments, where it automatically handles showing a single checkbox and saving a boolean (true/false) value when selected or unselected.  It's not too hard to do this without having a dedicated component, there's just some extra bending-over-backwards you need to implement everywhere it's used.

The Expression Guru
mikes0011
Brainy
September 19, 2023

Good one - I don't know if I knew they had a published recipe for it.  It's very similar to the one I wrote years ago, though in my version I allow potential values beyond just true/false if the user wishes to supply them.

The Expression Guru