August 10, 200124 yr 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?
August 10, 200124 yr 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 regards, Jeff
August 13, 200124 yr 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