Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

list box - how to force to choose only one value

Hello,

I have a list box with a set of values, and I want to force the user to choose only one at a time, not as many as he wants, how can I do this?

Thanks

Alexandra

16 Replies
amars
Specialist
Specialist

Hi alexandra,

Select a value in the list box & then go in Properties - > General Tab , there is a property "AtLeast one selected value" check that, which will force user to select at least one value at a time.

Regards

AmarSmile

Not applicable
Author

Thank you for your reply Amar, but I don't want to force the user to select at least one value, he can choose no value at all, I just don't want him to choose more than one. And that option is greyed out...

Thanks

andrus
Partner - Contributor
Partner - Contributor

This Box is selectible if you have selected only one value from the list.

Not applicable
Author

Hi andrus,

See, I have only one value selected from the list and still the option is greyed out...

andrus
Partner - Contributor
Partner - Contributor

Hi,

Seems, that parameter doesn't work for expressions, but only for "regular" fields:-(

Not applicable
Author

Oh.... that's probably it... I'm not sure I can do it without being an expression though...

Thanks for your help

andrus
Partner - Contributor
Partner - Contributor

Hi!

But maybe you can add this expression into your loading script.

Anonymous
Not applicable
Author

You cannot use "Always One..." in a calculated list box, but you can apply it to the underlying field, the one that you use in the expression.

johnw
Champion III
Champion III

So you want either 0 or 1 value to be selected, but never more than one? Here's an example of using a macro to do it. If more than one value is selected, it immediately deselects all but the first selected value. There might be a better way than using a macro, and for this specific case, there's probably a simpler macro (this was adapted from a macro to allow 1 to 5 values to be selected).