How to make a button, when clicked stay a color?

So, what I an trying to do is:

  1. When you click on a button, the background color of the button holds, until you click something else.

Is there any way?

Thanks!

This would be done through setting a custom state when the button is clicked and then changing the custom state when another button is clicked.

1 Like

Do you have a work flow example, please?

Not on hand, but I can walk you through briefly.

Create new custom state for button, call it “active” and make it yes/no
Set workflow when button is clicked to change custom state of that button to “active”=yes
set workflow of any other button click to change custom state of “active” button to no

4 Likes

Set condition of button to “when custom state is “active” then button color is xxx”

1 Like

So, I got it to work. But, the only thing is when one button is “active”, and I click another, the first “Active” button stays the same color. I want the one(first button) to remove the color, etc. And the second button is active.

If you have the buttons in a group you can have the state on the group instead, but instead of a yes/no, make it a text.
All the buttons in the group check the group state of Active.
If the Active state says it’s the current button, then button color is xxxx.

As you click one of the buttons, the workflow should set the corresponding state value to the button you clicked (using the label on it, an ID or whatever identifier you choose).

1 Like

You need to make sure the workflow on the other button sets the custom state of the first button back to “no” as well.

1 Like

It’s pretty difficult from just like texting/messaging, lol.

Create a Custom State:
image

Put as many buttons as you would like on the page with a Conditional for the button color looking at the Custom State you just created:
image

In your workflow for the button set the Custom State to the appropriate value:
image

1 Like

Thanks! So, I did what you showed, but when I click it; it shows the background color(different), but when another button is clicked it doesn’t remove the background color.

Can’t see your environment of course but maybe this:

  • Clicking Button B should set the custom state Active Button to the value Button B
  • Clicking Button C should set it to value Button C
    (bottom picture of my previous post)

Conditional on the buttons need to be Button A, Button B and Button C respectively. (see middle picture of my previous post)

1 Like

Okay! I am going to try, do you have a video that shows how to use it?

Never mind, I have gotten it to work!

This topic was automatically closed after 70 days. New replies are no longer allowed.