Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8572 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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

This topic is 8572 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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