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 color based on content...

Featured Replies

Is there any way to change the color of text in a field depending on the data in it? For example, I have a field ACTIVE which only contains either YES or NO. Is it possible to change the text color of YES in all the records that that contain YES in green?

Try an [FMP-If:] conditional on your format file.

Hi, yes it's quite easy when you've done it!!

Here's one that changes the colour of the table cell.

the database has a calculation field 'colourfield', which is:

----------------------

Case(status="on server","66ccff", status="accepted","00cc66", status="resend","ff3300", status="new version","66ccff","ffffff")

----------------------

so the cell turns blue, red, green, white depending on the status of the job

in the html:

----------------------

<TD WIDTH=50 BGCOLOR="#[fmp-field:colourfield]">

----------------------

In this database, the text is greyed out when the job is still with the production department, so I use an "IF" in the page:

----------------------

<FONT SIZE="-1" FACE="verdana,arial,geneva,sans-serif" [FMP-IF:status.cn.production]

COLOR="#999999"

[/FMP-IF]> <B>[FMP-FIELD: status]</B></FONT>

----------------------

I guess you could use an 'else' as well here

These are really easy to do and look cool to your boss/customer

wink.gif" border="0

regards, Jeff

Or you could make it really simple with a stylesheet in HTML.

Let's say you set two styles like this:

.yes = {font-color:#00cc66}

.no = {font-color:#00000}

Then you could write in your HTMl:

<p class="[FMP-field:Active]">This is text and it changes colour according to the active-field. </p>

Of course this only works in browsers that support stylesheets (which is meanwhile all the current ones).

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.