Color not changing
Application Type
Reactive

Hi Community,

I am working on UI using JavaScript.I have inserted few buttons and input widget in covid tracker screen

-All buttons color is changing but after again clicking on it it is not getting normal.

-In input widget I have used If condition in JS but the condition is getting false.

-I have also shared my .oml file


Thanks.

JSUI.oml

Can i ask why you want to use javascript?

I would create different classes in CSS and use the If in the Style Classes of the button.


For practise.


What do you want to prove with that test? 


Do you want to learn on how to use javascript in Outsystems?

Yes

I have no idea what you want with your code: if you expect it to return to normal, where do you have the code that does that?


Did you follow this guide?


https://www.outsystems.com/training/courses/44/master-class-on-javascript-and-jquery/

https://www.outsystems.com/evaluation-guide/extending-the-ui-with-html-javascript-and-css/

Yes Sure, I'll go through the link.

After clicking on button color changes and if i click on that button again the color should go.

You need some sort of toggle function. since you wnat to do it in javascript, you should check it the background color is x, then change to y, if not change to x.

Hi Vinay,

I hope your are doing well!!

You can take reference of below link,

https://www.outsystems.com/forums/discussion/41672/how-to-use-javascript-in-mobile-app-to-change-color-of-button-on-click/


Kind Regards,

Ajit Kurane.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.