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 text or background?

Featured Replies

Hi,

This may be a calculation rather that a script requirement?

Basically I need to change either the background colour or the text colour based upon a choice of Yes or No.

So if a field = "Yes" then I want to change the background to say red(or the text) and if the field = "No" then I want to have the field change to say Green!

I thought of having a container with a graphic colour saying yes and a graphic colour saying no and setting the field with the necessary colour but I need to use the words Yes or No and I can't do this using a container.

I need to "Get Graphic Colour" somehow?

Can anyone help?

Create a calculation whose output type is Container (down in the lower left of the Define Calculation):

Case(myfield= "Yes", backgroundfield, "")

Put background file behind the input field, same size. The calc field should be set to not allow entry. You can put whatever color you want into the backgroundfield.

Steve

If the background need only cover a few lines, you can use this method without container fields. Just have the calculation field with a formula similar to this:

Let( a ="llllllllllllllllllllllllllllllllllllllll" ;

Case(field="YES"; TextColor( a ;RGB( 200;0 ;0)) ; TextColor( a ;RGB( 0;200 ;0)) ) )

Those are lower case l's, bold, sized, sans serif - duplicate the field to cover the gaps. The group of l's can have returns in the formula to cover more verticle area.

Also, in your case, in lieu of l's, you could use the words YES and NO.

The advantage here is flexibility. You can easily add, or change, a rainbow of meaning in seconds without adding or changing container fields. A Left function can even determine the width of the highlight.

David

  • Author

Hi thanks for you help, works well..

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.