Forum Discussion

KevinMcGrath's avatar
KevinMcGrath
Community Member
2 years ago

How to disable one button when two other buttons are selected?

Hi all,

I have three buttons (A, B, C). I want the user to be able to only select two of them at a time. That is, if they have chosen two buttons (A & C) the third (B) is disabled and then if they want to change their choice they must first deselect one button (A or C) to be able to select the (otherwise disabled, B) button. Hope this makes sense.

I just can't work out the best way for this to work with triggers. 

Many thanks,

Kevin

  • Going to need a few triggers to do it, I can think of a few ways not sure which is the simplest.

    You could show a layer that is shown each time you press a button and then do a count of how many are selected and if equal to 2 disable the button that was not equal to selected.

    Or you could add triggers if

    A+B = selected disable C

    A+C = selected disable B

    B + C = selected disable A

    You then need triggers to change back to normal and the layer option is probably better here as you can use the count to change any disabled back to normal

  • KevinMcGrath's avatar
    KevinMcGrath
    Community Member

    Awesome, thanks Phil!
    I set enable triggers to change the state back to normal with:

    Set state of X to Normal when Count changes if the state of x = Disabled

    Hadn't considered the layer option, great to have a few ways to solve this. Really appreciate your help.

    Kind regards, Kevin