Change button color when is pressed?

Hello,

How can I change the color of the buttons when its pressed (when someone click on it)


Cheers!

David Fernandes wrote:

Hello,

How can I change the color of the buttons when its pressed (when someone click on it)


Cheers!

Hi,

Use onClick Event Action for the buttons & apply CSS to the respective button.

1- Pass Button ID to Button OnClick Action

2- Use below JS under the onClick Action

document.getElementById("buttonID").style.backgroundColor = "lightblue";


assif_tiger wrote:

David Fernandes wrote:

Hello,

How can I change the color of the buttons when its pressed (when someone click on it)


Cheers!

Hi,

Use onClick Event Action for the buttons & apply CSS to the respective button.

1- Pass Button ID to Button OnClick Action

2- Use below JS under the onClick Action

document.getElementById("buttonID").style.backgroundColor = "lightblue";


For web applications right?


David Fernandes wrote:

assif_tiger wrote:

David Fernandes wrote:

Hello,

How can I change the color of the buttons when its pressed (when someone click on it)


Cheers!

Hi,

Use onClick Event Action for the buttons & apply CSS to the respective button.

1- Pass Button ID to Button OnClick Action

2- Use below JS under the onClick Action

document.getElementById("buttonID").style.backgroundColor = "lightblue";


For web applications right?


Can be used for web or Mobile too


Without using JavaScript it can done.

Suhas Jamdade wrote:

Without using JavaScript it can done.

Hi Suhas,

I totally agree there is some other approach too :

1- Creating a Boolean variable & setting it on Button Click event.

    And using it in Style class like : if(isBtnClick, "ActiveCSSClassName","DeActiveCSSClassName")

2-It can be done by overriding the Button Default CSS of Outsystems

3- JavaScript [Mention above]

It totally depends on the business requirement & feasibility of screen to with particular approach.

- Assif