Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Determine the # of items selected in a checkbox set

Featured Replies

I want to determine the # of items selected in a checkbox set and adjust the background color of the label when it falls within a certain range

Lable(max 2)

[]option1

[]option2

[]option3

[]option4

for instance I want the label's background to be red when nothing is selected

And when at least 1 is selected but not greater than 2 selected - I want the background green

ValueCount(Field) will tell you how many items are checked in a checkbox / radio button

I deleted your Duplicate Post.

I want to limit the total number of selections in a checkbox set.

I see how you can limit by number of characters, uniqueness and value. Is it possible to limit the total number of selections.

Checkbox Set (Max 3)

[]

[]

[]

[]

[]

[]

so to only allow up to three selections.

Thank you.

I made a quick sample of your original post (see attachment).

If you only have version 8.5 as you stated, then you will not see any thing in the Label Field on the Right.

Lee

[color:red]p.s.

You will have to adjust the numbers in the calculation to match your new request.

lanceomni.fp7.zip

Edited by Guest
p.s.

I want to limit the total number of selections in a checkbox set.

... Checkbox Set (Max 3)

This is another way to obtain what you asked.

lanceomni.zip

Erhm! Shouldn't it be:

Case(

ValueCount ( Max 3 Check ) > 4 ; LeftValues ( Max 3 Check ; 3 ) ;

Max 3 Check

)

But still are there issues, which needs a little tightning up, if you intially have selected box {1;3;5} and tries to set 2, will both {2;5} be cleared.

--sd

I don't think so...

have you tried my file ?

P.S.:) At least on Win the calc is correct and performs right.

It doesn't work correctly, because the field also contains the value "Option 6", which isn't part of the value list, but is counted. So I can only check up to 2 (additional) values.

In any case, the formula can be simply:

LeftValues ( CheckBoxField ; 3 )

or:

RightValues ( CheckBoxField ; 3 )

depending on the desired behavior.

Ok I think I've got it fixed:

Case(

ValueCount ( List(Max 3 Check )) > 4 ; LeftValues ( List(Max 3 Check) ; 4 ) ;

List(Max 3 Check)

)

--sd

:idunno:

This is ( and I can see it ) the "Options" value list:

Option 1

Option 2

Option 3

Option 4

Option 5

Option 6

BTW: your calc is better ( to see ) :)

Ah. This is what threw me off. Another lesson that fields need to be enlarged for cross-platform compatibility.

cb.gif

What difference does it make, when you are using LeftValues ()?

It would be different with RightValues(), but I don't think users would like it very much. I would expect a FIFO order, possibly LIFO, but certainly not the value list order.

I can see such needs...

for example Alpha order, Numeric order or even custom list order in a text field or in a calculated one like Trim ( Substitute ( checkField ; ¶ ; " " ) )

Max_3_CheckMOD2.zip

Ah (for the second time). I thought you wanted to take the first/last 3 choices of user in alphabetical order.

I see why you would sometimes want to sort a checkbox, but it doesn't seem to be relevant to the thread's topic.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.