Skip 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.

changing a field background color

Featured Replies

Hi, newbie here. great forum, lots of useful tips. Been using it for a while now, before taking the pludge to join in.

I've come across a problem, and I don't know how to solve it.

Does anyone know a script that will check the value within a field and then change the background color to say red or green depending on whether the value is a positive or negative number?

Any help or advice greatly appreciated.

Hello and welcome to the forums. You can try a search for +field +color and you will get a few hits regarding this matter.

Here is one of them

In your case the calc would be something like Case ( Sign (numfield) = -1; gBackround; gBackround[2] )

Where the first repetition of your container field would be a red image and the second green.

Or if you were going to have a different color for zero then since you would need three colors, I would use a calc like.

Choose ( Sign (numfield) + 1; gBackround; gBackround[2]; gBackround[3] )

Where the first repetition of your container field would be a red image for negative, the second repetition be orange or whatever color for zero, and the third repetition green for possitive amounts.

  • Author

Hi, thanks for the the help.

I get the Case function and the Sign function. What I need help with is the code to change the background color (the bit that goes in gBackround). I can't find any functions that reference background color to change it?

Did you do the search and read the thread that I pointed out? There were examples on there that were pretty straight forward. Click on the "Here is one of them". It is a link.

  • Author

Whooops! missed the link.

But did do a search for "gBackround" and found it that way. Having looked at the solution I was going completely in the wrong direction. The answer is very simple (the best way).

Thanks for your help on this - much appreciated. Apologies for being a numpty.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.